@eliseevnp/mjs-test-launcher
v1.0.1
Published
Test launcher for mjs-mocha
Downloads
592
Readme
Test launcher for mjs-mocha
Configuration
Create file, for example launcher.mjs
Add script to your package.json:
{
"test": "node --experimental-modules ./launcher.mjs"
}
All variables in config are defined by default as in example below, override them if you want.
launcher.mjs:
import launch from '@eliseevnp/mjs-test-launcher';
launch({
env: {
NODE_ENV: 'test',
MYSQL_USER: 'root',
MYSQL_PASSWORD: 'root',
MYSQL_DATABASE: 'test',
MYSQL_HOST: 'localhost'
},
db: false,
dir: './src/tests',
migrations_dir: './src/db',
ext: ['mjs', 'js'] // all files ending with '*test.mjs' and '*test.js' will be tested
});