Skip to content

Commit

Permalink
Update types. closes #950
Browse files Browse the repository at this point in the history
  • Loading branch information
hueniverse committed Oct 14, 2019
1 parent 8316c57 commit 717f852
Show file tree
Hide file tree
Showing 12 changed files with 855 additions and 595 deletions.
4 changes: 0 additions & 4 deletions .gitattributes

This file was deleted.

1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: node_js

node_js:
- "8"
- "10"
- "12"
- "node"
Expand Down
680 changes: 357 additions & 323 deletions API.md
100644 → 100755

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Coverage = require('./coverage');
const Pkg = require('../package.json');
const Runner = require('./runner');
const Transform = require('./transform');
const Utils = require('./utils');

// .labrc configuration will be required if it exists
// index.js required below if setting assertions module

Expand Down Expand Up @@ -114,7 +114,9 @@ internals.traverse = function (paths, options) {
process.exit(1);
}

if (options.pattern && !testFiles.length) {
if (options.pattern &&
!testFiles.length) {

console.log('The pattern provided (-P or --pattern) didn\'t match any files.');
process.exit(0);
}
Expand Down Expand Up @@ -148,7 +150,7 @@ internals.traverse = function (paths, options) {
scripts.push(pkg.lab);

if (pkg.lab._cli) {
Utils.applyOptions(options, pkg.lab._cli);
Object.assign(options, pkg.lab._cli);
}
}
else if (global._labScriptRun) {
Expand Down Expand Up @@ -448,7 +450,7 @@ internals.options = function () {
process.exit(0);
}

const options = Utils.mergeOptions(defaults, internals.rc);
const options = Object.assign({}, defaults, internals.rc);
options.paths = argv._ ? [].concat(argv._) : options.paths;

const keys = ['assert', 'bail', 'colors', 'context-timeout', 'coverage', 'coverage-exclude',
Expand All @@ -471,8 +473,12 @@ internals.options = function () {
options.ids = argv.id;
}

if (Array.isArray(options.reporter) && options.output) {
if (!Array.isArray(options.output) || options.output.length !== options.reporter.length) {
if (Array.isArray(options.reporter) &&
options.output) {

if (!Array.isArray(options.output) ||
options.output.length !== options.reporter.length) {

console.error(Bossy.usage(definition, 'lab [options] [path]'));
process.exit(1);
}
Expand Down Expand Up @@ -533,6 +539,7 @@ internals.options = function () {
return options;
};


internals.mapTransform = function (transform) {

return transform.ext.substr(1).replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
Expand Down
Loading

0 comments on commit 717f852

Please sign in to comment.