Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
22 lines
465 B
JavaScript
22 lines
465 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
var fs = require('fs');
|
|
var N = 100;
|
|
var j = 0;
|
|
|
|
for (var i = 0; i < N; i++) {
|
|
// these files don't exist
|
|
fs.stat('does-not-exist-' + i, function(err) {
|
|
if (err) {
|
|
j++; // only makes it to about 17
|
|
console.log('finish ' + j);
|
|
} else {
|
|
throw new Error('this shouldn\'t be called');
|
|
}
|
|
});
|
|
}
|
|
|
|
process.on('exit', function() {
|
|
assert.equal(N, j);
|
|
});
|