Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ff5345c

Browse filesBrowse files
joshua-belcherMylesBorins
authored andcommitted
test: fix order of assert.strictEqual() args to actual, expected
PR-URL: #23501 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent f5fd8a2 commit ff5345c
Copy full SHA for ff5345c

File tree

Expand file treeCollapse file tree

1 file changed

+12
-13
lines changed
Open diff view settings
Filter options
  • test/addons-napi/test_make_callback
Expand file treeCollapse file tree

1 file changed

+12
-13
lines changed
Open diff view settings
Collapse file

‎test/addons-napi/test_make_callback/test.js‎

Copy file name to clipboardExpand all lines: test/addons-napi/test_make_callback/test.js
+12-13Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,21 @@ function myMultiArgFunc(arg1, arg2, arg3) {
1313
return 42;
1414
}
1515

16-
assert.strictEqual(42, makeCallback(process, common.mustCall(function() {
16+
assert.strictEqual(makeCallback(process, common.mustCall(function() {
1717
assert.strictEqual(0, arguments.length);
1818
assert.strictEqual(this, process);
1919
return 42;
20-
})));
20+
})), 42);
2121

22-
assert.strictEqual(42, makeCallback(process, common.mustCall(function(x) {
23-
assert.strictEqual(1, arguments.length);
22+
assert.strictEqual(makeCallback(process, common.mustCall(function(x) {
23+
assert.strictEqual(arguments.length, 1);
2424
assert.strictEqual(this, process);
2525
assert.strictEqual(x, 1337);
2626
return 42;
27-
}), 1337));
27+
}), 1337), 42);
2828

29-
assert.strictEqual(42,
30-
makeCallback(this,
31-
common.mustCall(myMultiArgFunc), 1, 2, 3));
29+
assert.strictEqual(makeCallback(this,
30+
common.mustCall(myMultiArgFunc), 1, 2, 3), 42);
3231

3332
// TODO(node-api): napi_make_callback needs to support
3433
// strings passed for the func argument
@@ -47,12 +46,12 @@ const recv = {
4746
}),
4847
};
4948
50-
assert.strictEqual(42, makeCallback(recv, 'one'));
51-
assert.strictEqual(42, makeCallback(recv, 'two', 1337));
49+
assert.strictEqual(makeCallback(recv, 'one'), 42);
50+
assert.strictEqual(makeCallback(recv, 'two', 1337), 42);
5251
5352
// Check that callbacks on a receiver from a different context works.
5453
const foreignObject = vm.runInNewContext('({ fortytwo() { return 42; } })');
55-
assert.strictEqual(42, makeCallback(foreignObject, 'fortytwo'));
54+
assert.strictEqual(makeCallback(foreignObject, 'fortytwo'), 42);
5655
*/
5756

5857
// Check that the callback is made in the context of the receiver.
@@ -63,7 +62,7 @@ const target = vm.runInNewContext(`
6362
return Object;
6463
})
6564
`);
66-
assert.notStrictEqual(Object, makeCallback(process, target, Object));
65+
assert.notStrictEqual(makeCallback(process, target, Object), Object);
6766

6867
// Runs in inner context.
6968
const forward = vm.runInNewContext(`
@@ -79,4 +78,4 @@ function endpoint($Object) {
7978
return Object;
8079
}
8180

82-
assert.strictEqual(Object, makeCallback(process, forward, endpoint));
81+
assert.strictEqual(makeCallback(process, forward, endpoint), Object);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.