Browse Source

fix some XO lint issues

browser-support
Sindre Sorhus 9 years ago
parent
commit
40025a5c9c
  1. 2
      bench/run.js
  2. 2
      index.js
  3. 2
      lib/logger.js
  4. 2
      lib/test-worker.js
  5. 2
      test/api.js
  6. 4
      test/cli.js
  7. 6
      test/watcher.js

2
bench/run.js

@ -102,7 +102,7 @@ Promise.each(combined, function (definition) {
if (result.err && !definition.shouldFail) { if (result.err && !definition.shouldFail) {
console.log(result.stdout); console.log(result.stdout);
console.log(result.stderr); console.log(result.stderr);
throw (result.err); throw result.err;
} }
results[key] = results[key] || []; results[key] = results[key] || [];
results[key].push({passed: !results.err, shouldFail: definition.shouldFail, time: seconds}); results[key].push({passed: !results.err, shouldFail: definition.shouldFail, time: seconds});

2
index.js

@ -25,7 +25,7 @@ if (!isForked) {
console.log(); console.log();
console.error('Test files must be run with the AVA CLI:\n\n ' + chalk.grey.dim('$') + ' ' + chalk.cyan('ava ' + fp) + '\n'); console.error('Test files must be run with the AVA CLI:\n\n ' + chalk.grey.dim('$') + ' ' + chalk.cyan('ava ' + fp) + '\n');
process.exit(1); process.exit(1); // eslint-disable-line
} }
// if fail-fast is enabled, use this variable to detect // if fail-fast is enabled, use this variable to detect

2
lib/logger.js

@ -99,6 +99,6 @@ Logger.prototype.exit = function (code) {
// timeout required to correctly flush IO on Node.js 0.10 on Windows // timeout required to correctly flush IO on Node.js 0.10 on Windows
setTimeout(function () { setTimeout(function () {
process.exit(code); process.exit(code); // eslint-disable-line
}, process.env.AVA_APPVEYOR ? 500 : 0); }, process.env.AVA_APPVEYOR ? 500 : 0);
}; };

2
lib/test-worker.js

@ -119,7 +119,7 @@ process.on('ava-exit', function () {
var delay = process.env.AVA_APPVEYOR ? 100 : 0; var delay = process.env.AVA_APPVEYOR ? 100 : 0;
globals.setTimeout(function () { globals.setTimeout(function () {
process.exit(0); process.exit(0); // eslint-disable-line
}, delay); }, delay);
}); });

2
test/api.js

@ -893,7 +893,7 @@ test('babelConfig:{extends:path, plugins:[...]} merges plugins with .babelrc', f
api.on('test-run', function (runStatus) { api.on('test-run', function (runStatus) {
runStatus.on('test', function (data) { runStatus.on('test', function (data) {
t.ok((data.title === 'BAR')); t.is(data.title, 'BAR');
}); });
}); });

4
test/cli.js

@ -176,7 +176,7 @@ test('pkg-conf: cli takes precedence', function (t) {
}); });
}); });
test("watcher reruns test files when they changed", function (t) { test('watcher reruns test files when they changed', function (t) {
var killed = false; var killed = false;
var child = execCli(['--verbose', '--watch', 'test.js'], {dirname: 'fixture/watcher'}, function (err, stdout, stderr) { var child = execCli(['--verbose', '--watch', 'test.js'], {dirname: 'fixture/watcher'}, function (err, stdout, stderr) {
@ -209,7 +209,7 @@ test("watcher reruns test files when they changed", function (t) {
}); });
if (hasChokidar) { if (hasChokidar) {
test("watcher reruns test files when source dependencies change", function (t) { test('watcher reruns test files when source dependencies change', function (t) {
var killed = false; var killed = false;
var child = execCli(['--verbose', '--watch', '--source=source.js', 'test-*.js'], {dirname: 'fixture/watcher/with-dependencies'}, function (err) { var child = execCli(['--verbose', '--watch', '--source=source.js', 'test-*.js'], {dirname: 'fixture/watcher/with-dependencies'}, function (err) {

6
test/watcher.js

@ -654,7 +654,7 @@ group('chokidar is installed', function (beforeEach, test, group) {
}); });
}); });
["r", "rs"].forEach(function (input) { ['r', 'rs'].forEach(function (input) {
test('reruns initial tests when "' + input + '" is entered on stdin', function (t) { test('reruns initial tests when "' + input + '" is entered on stdin', function (t) {
t.plan(4); t.plan(4);
api.run.returns(Promise.resolve(runStatus)); api.run.returns(Promise.resolve(runStatus));
@ -1291,7 +1291,7 @@ group('chokidar is installed', function (beforeEach, test, group) {
}); });
}); });
test("previous failures don't count when that file is rerun", function (t) { test('previous failures don\'t count when that file is rerun', function (t) {
t.plan(1); t.plan(1);
var same; var same;
@ -1306,7 +1306,7 @@ group('chokidar is installed', function (beforeEach, test, group) {
}); });
}); });
test("previous failures don't count when that file is deleted", function (t) { test('previous failures don\'t count when that file is deleted', function (t) {
t.plan(1); t.plan(1);
var same; var same;

Loading…
Cancel
Save