Skip to content

Commit bd14a06

Browse files
committed
fixup! tools: add lint rule to ensure assertions are reached
1 parent 747d5e6 commit bd14a06

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

test/node-api/test_threadsafe_function/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function testUnref(queueSize) {
7979

8080
new Promise(function testWithoutJSMarshaller(resolve) {
8181
let callCount = 0;
82-
binding.StartThreadNoNative(function testCallback() {
82+
binding.StartThreadNoNative(common.mustCallAtLeast(function testCallback() {
8383
callCount++;
8484

8585
// The default call-into-JS implementation passes no arguments.
@@ -91,7 +91,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
9191
}, false);
9292
});
9393
}
94-
}, false /* abort */, false /* launchSecondary */, binding.MAX_QUEUE_SIZE);
94+
}), false /* abort */, false /* launchSecondary */, binding.MAX_QUEUE_SIZE);
9595
})
9696

9797
// Start the thread in blocking mode, and assert that all values are passed.

test/pummel/test-child-process-spawn-loop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const doSpawn = common.mustCall((i) => {
5252
finished = true;
5353
}
5454
}));
55-
}, N);
55+
}, N + 1);
5656

5757
doSpawn(0);
5858

test/pummel/test-fs-watch-file-slow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fs.watchFile(FILENAME, { interval: TIMEOUT - 250 }, common.mustCall((curr, prev)
5555
default:
5656
assert(0);
5757
}
58-
}));
58+
}, 4));
5959

6060
process.on('exit', function() {
6161
assert.strictEqual(nevents, 4);

test/pummel/test-fs-watch-non-recursive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ const filepath = path.join(testsubdir, 'watch.txt');
3939
fs.mkdirSync(testsubdir, 0o700);
4040

4141
const doWatch = common.mustCall(() => {
42-
const watcher = fs.watch(testDir, { persistent: true }, common.mustCall((event, filename) => {
42+
const watcher = fs.watch(testDir, { persistent: true }, common.mustCallAtLeast((event, filename) => {
4343
// This function may be called with the directory depending on timing but
4444
// must not be called with the file..
4545
assert.strictEqual(filename, 'testsubdir');
46-
}));
46+
}, 0));
4747
setTimeout(() => {
4848
fs.writeFileSync(filepath, 'test');
4949
}, 100);

test/pummel/test-http-many-keep-alive-connections.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const server = http.Server(common.mustCall((req, res) => {
3434
assert.strictEqual(req.connection, connection);
3535
res.writeHead(200);
3636
res.end('hello world\n');
37-
}));
37+
}, expected));
3838

3939
server.once('connection', function(c) {
4040
connection = c;

test/pummel/test-net-many-clients.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function runClient(port, callback) {
6262
client.end();
6363
});
6464

65-
client.on('close', common.mustCall((had_error) => {
65+
client.on('close', common.mustCall(function(had_error) {
6666
assert.strictEqual(had_error, false);
6767
assert.strictEqual(client.recved.length, bytes);
6868

test/pummel/test-tls-server-large-request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const options = {
3939
class Mediator extends stream.Writable {
4040
buf = '';
4141

42-
_write = common.mustCall((data, enc, cb) => {
42+
_write = common.mustCallAtLeast((data, enc, cb) => {
4343
this.buf += data;
4444
setTimeout(cb, 0);
4545

0 commit comments

Comments
 (0)