muttley
Version:
Monitor Unit Test Tool
58 lines • 1.77 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const yargs_1 = __importDefault(require("yargs"));
const configstore_1 = __importDefault(require("configstore"));
// eslint-disable-next-line prefer-destructuring
const argv = yargs_1.default
.command('* [paths...]', 'Monitor all Unit Tests in the paths. If no paths supplied use current directory.', (args) => {
return args.positional('paths', {
describe: 'paths to watch',
type: 'string',
default: '.',
});
})
.option('verbose', {
alias: 'v',
description: 'Log to file. Pass info|debug|warn etc',
type: 'string',
})
.help()
.alias('help', 'h').argv;
exports.argv = argv;
const configStore = new configstore_1.default('mutt', {
refreshIntervalMs: 500,
dependencyModule: './dependency',
testCmd: 'mocha',
testArgs: ['--reporter=xunit', '--require', 'source-map-support/register'],
});
/**
* Config provides type safe accessors over the configStore object
*/
const config = {
/**
* get the refresh rate for the display
*/
get refreshIntervalMs() {
return configStore.get('refreshIntervalMs');
},
/**
* set the refresh rate for the display
*/
set refreshIntervalMs(interval) {
configStore.set('intervalMs', interval);
},
get dependencyModule() {
return configStore.get('dependencyModule');
},
get testCmd() {
return configStore.get('testCmd');
},
get testArgs() {
return configStore.get('testArgs');
},
};
exports.config = config;
//# sourceMappingURL=command-line.js.map