0.21.0 • Published 2 years ago
module-testrunner v0.21.0
Module Testrunner
Runs test files that export a top level function to enable initialisation.
Table of Contents
Install
https://www.npmjs.com/package/module-testrunner
npm install module-testrunnerUsage
CLI
npx test test_filesAPI
const { run } = require('module-testrunner');
const options = { ... };
run(options);Options
files: Array of test file paths.args: Array of custom test arguments. Default: Result of loadingmainfrompackage.jsonor./index.js.test: Function that runs a test. Default: Result of loadingnode:test.assert: Assertion library. Default: Result of loadingnode:assert.context: Additional context object to make accessible to each test.
Example
Basic
module.exports = ({ test, assert }) => {
test('it passes', () => {
assert(true);
});
};Advanced
module.exports = ({ test, assert, context }) => args => {
test('initialises the app', () => {
const app = args.initialise();
assert(context.helpers.appInitialised(app));
});
};0.21.0
2 years ago
0.20.0
2 years ago
0.19.0
2 years ago
0.18.0
2 years ago
0.17.0
2 years ago
0.16.0
2 years ago
0.15.0
2 years ago
0.14.0
2 years ago
0.13.0
2 years ago
0.12.0
2 years ago
0.11.0
2 years ago
0.10.0
2 years ago
0.9.0
2 years ago
0.8.0
2 years ago
0.7.0
2 years ago
0.6.0
2 years ago
0.5.0
2 years ago
0.4.0
2 years ago
0.3.0
2 years ago
0.2.0
2 years ago
0.1.0
2 years ago