node-test-runner

A no-setup test runner

Usage no npm install needed!

<script type="module">
  import nodeTestRunner from 'https://cdn.skypack.dev/node-test-runner';
</script>

README

# node-test-runner

I hate to installed all my test dependencies into my project directory, now you can install node-test-runner globally to test all your node projects.

Install

$ npm install -g node-test-runner

Usage

Karma

Assuming you have a directory structure like:

├── src
│   ├── css
│   │   ├── class.js
│   │   └── style.js
│   ├── dom
│   │   ├── each.js
│   │   ├── is.js
│   │   ├── isType.js
│   │   └── manipulations.js
│   └── simple.js
└── tests
    ├── css
    │   ├── test-class.js
    │   └── test-style.js
    ├── dom
    │   └── test-each.js
    ├── helpers
    │   └── create-elements.js
    └── test-simple.js

Run:

# run karma test once
$ ntr karma
# run karma in watch mode
$ ntr karma --watch/-w

Or you can customize your own directory structure, just check out default Karma Configs, you can override all of them in .ntrrc file, like:

{
  "karma": {
    "files": [
      "spec/**/*Spec.js"
    ]
  }
}

License

MIT © EGOIST