npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

argus-test-runner

v3.0.1

Published

Watches for changes in your source and test files and executes automatic tests

Downloads

13

Readme

Argus test runner

npm Travis (.org) Coveralls github

Watches your files and executes automated tests for them when they change.

Note

These are the docs for 3.0.0 version. For version 2.0 documentation see here. For version 1.4 documentation see here.

Requirements

  • Node.js v12 or greater
  • npm v6 or greater

Installation

Global installation

  1. npm install -g argus-test-runner
  2. Navigate to your project root
  3. Create a configuration file named argus.config.js (see configuration examples)
  4. Type argus to start watching tests and corresponding production files
  5. Type argus -h for usage information

Local installation

  1. If you already have a package.json in your project, you can also install argus-test-runner locally

  2. Navigate to your project root and type npm install --save-dev argus-test-runner

  3. Create a configuration file named argus.config.js (see configuration examples)

  4. Start Argus with ./node_modules/.bin/argus

  5. You can also add an npm script for convenience in your package.json:

        "devDependencies": {
          "argus-test-runner": "^3.0.0"
        },
        "scripts": {
          "test:watch": "argus"
        }

    and run npm run test:watch

To stop watching files just press Ctrl + C.

Configuration

You must configure argus-test-runner by creating a configuration file. By default, argus looks for the configuration file named argus.config.js in the directory in which it is run, but you can specify a different location via -c console parameter, for example argus -c ../my.custom.argus.config.js. Configuration files are written in Javascript.

Configuration file examples

PHPUnit unit tests

module.exports = {
  environments: [
    {
      // File extension, in this case we are watching PHP files
      extension: 'php',
      // Suffix by which test files are identified
      testNameSuffix: 'Test',
      // Test directory mirrors your source directory structure
      testDir: 'tests',
      sourceDir: 'src',
      testRunnerCommand: { command: 'vendor/bin/phpunit', arguments: [] },
    },
  ],
};

PHPUnit unit and integration tests

module.exports = {
  environments: [
    // Unit test environment
    {
      extension: 'php',
      testNameSuffix: 'Test',
      testDir: 'tests/unit',
      sourceDir: 'src',
      testRunnerCommand: { command: 'vendor/bin/phpunit', arguments: [] },
    },
    // Integration environment
    {
      extension: 'php',
      testNameSuffix: 'Test',
      testDir: 'tests/integration',
      sourceDir: 'src',
      // If you are using a different configuration file for your integration tests, you can specify it in the
      // arguments list
      testRunnerCommand: {
        command: 'vendor/bin/phpunit',
        arguments: ['-c', 'phpunit-integration.xml'],
      },
    },
  ],
};

PHPUnit unit tests and Javascript unit tests

module.exports = {
  environments: [
    // PHPUnit test environment
    {
      extension: 'php',
      testNameSuffix: 'Test',
      testDir: 'tests/unit',
      sourceDir: 'src',
      testRunnerCommand: { command: 'vendor/bin/phpunit', arguments: [] },
    },
    // Javascript unit test environment
    {
      extension: 'js',
      testNameSuffix: '.test',
      testDir: 'tests/unit',
      sourceDir: 'src',
      // If you are using mocha for your Javascript tests
      testRunnerCommand: { command: 'node_modules/.bin/mocha', arguments: [] },
      // You can define a custom command to run all tests (runs when you press "a" when Argus is running).
      // Otherwise Argus will use testRunnerCommand and its arguments to run all tests.
      runAllTestsCommand: { command: 'npm', arguments: ['t'] },
    },
  ],
};