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 faba8d4

Browse filesBrowse files
aduh95MylesBorins
authored andcommitted
test: add trailing commas in test/js-native-api
PR-URL: #46385 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 6cf860d commit faba8d4
Copy full SHA for faba8d4

File tree

Expand file treeCollapse file tree

12 files changed

+43
-44
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

12 files changed

+43
-44
lines changed
Open diff view settings
Collapse file

‎test/.eslintrc.yaml‎

Copy file name to clipboardExpand all lines: test/.eslintrc.yaml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ overrides:
7676
- files:
7777
- es-module/*.js
7878
- es-module/*.mjs
79-
- js-native-api/*/*.js
8079
- parallel/*.js
8180
- parallel/*.mjs
8281
- pummel/*.js
Collapse file

‎test/js-native-api/test_array/test.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_array/test.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ assert.throws(
2323
() => {
2424
test_array.TestGetElement(array, array.length + 1);
2525
},
26-
/^Error: assertion \(\(\(uint32_t\)index < length\)\) failed: Index out of bounds!$/
26+
/^Error: assertion \(\(\(uint32_t\)index < length\)\) failed: Index out of bounds!$/,
2727
);
2828

2929
assert.throws(
3030
() => {
3131
test_array.TestGetElement(array, -2);
3232
},
33-
/^Error: assertion \(index >= 0\) failed: Invalid index\. Expects a positive integer\.$/
33+
/^Error: assertion \(index >= 0\) failed: Invalid index\. Expects a positive integer\.$/,
3434
);
3535

3636
array.forEach(function(element, index) {
Collapse file

‎test/js-native-api/test_bigint/test.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_bigint/test.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ assert.throws(() => CreateTooBigBigInt(), {
4848
// Test that we correctly forward exceptions from the engine.
4949
assert.throws(() => MakeBigIntWordsThrow(), {
5050
name: 'RangeError',
51-
message: 'Maximum BigInt size exceeded'
51+
message: 'Maximum BigInt size exceeded',
5252
});
Collapse file

‎test/js-native-api/test_constructor/test.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_constructor/test.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ assert.deepStrictEqual(TestConstructor.TestDefineClass(), {
5858
cbIsNull: 'Invalid argument',
5959
cbDataIsNull: 'napi_ok',
6060
propertiesIsNull: 'Invalid argument',
61-
resultIsNull: 'Invalid argument'
61+
resultIsNull: 'Invalid argument',
6262
});
Collapse file

‎test/js-native-api/test_conversions/test.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_conversions/test.js
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,76 +143,76 @@ assert.deepStrictEqual(test.testNull.getValueBool(), {
143143
envIsNull: 'Invalid argument',
144144
valueIsNull: 'Invalid argument',
145145
resultIsNull: 'Invalid argument',
146-
inputTypeCheck: 'A boolean was expected'
146+
inputTypeCheck: 'A boolean was expected',
147147
});
148148

149149
assert.deepStrictEqual(test.testNull.getValueInt32(), {
150150
envIsNull: 'Invalid argument',
151151
valueIsNull: 'Invalid argument',
152152
resultIsNull: 'Invalid argument',
153-
inputTypeCheck: 'A number was expected'
153+
inputTypeCheck: 'A number was expected',
154154
});
155155

156156
assert.deepStrictEqual(test.testNull.getValueUint32(), {
157157
envIsNull: 'Invalid argument',
158158
valueIsNull: 'Invalid argument',
159159
resultIsNull: 'Invalid argument',
160-
inputTypeCheck: 'A number was expected'
160+
inputTypeCheck: 'A number was expected',
161161
});
162162

163163
assert.deepStrictEqual(test.testNull.getValueInt64(), {
164164
envIsNull: 'Invalid argument',
165165
valueIsNull: 'Invalid argument',
166166
resultIsNull: 'Invalid argument',
167-
inputTypeCheck: 'A number was expected'
167+
inputTypeCheck: 'A number was expected',
168168
});
169169

170170

171171
assert.deepStrictEqual(test.testNull.getValueDouble(), {
172172
envIsNull: 'Invalid argument',
173173
valueIsNull: 'Invalid argument',
174174
resultIsNull: 'Invalid argument',
175-
inputTypeCheck: 'A number was expected'
175+
inputTypeCheck: 'A number was expected',
176176
});
177177

178178
assert.deepStrictEqual(test.testNull.coerceToBool(), {
179179
envIsNull: 'Invalid argument',
180180
valueIsNull: 'Invalid argument',
181181
resultIsNull: 'Invalid argument',
182-
inputTypeCheck: 'napi_ok'
182+
inputTypeCheck: 'napi_ok',
183183
});
184184

185185
assert.deepStrictEqual(test.testNull.coerceToObject(), {
186186
envIsNull: 'Invalid argument',
187187
valueIsNull: 'Invalid argument',
188188
resultIsNull: 'Invalid argument',
189-
inputTypeCheck: 'napi_ok'
189+
inputTypeCheck: 'napi_ok',
190190
});
191191

192192
assert.deepStrictEqual(test.testNull.coerceToString(), {
193193
envIsNull: 'Invalid argument',
194194
valueIsNull: 'Invalid argument',
195195
resultIsNull: 'Invalid argument',
196-
inputTypeCheck: 'napi_ok'
196+
inputTypeCheck: 'napi_ok',
197197
});
198198

199199
assert.deepStrictEqual(test.testNull.getValueStringUtf8(), {
200200
envIsNull: 'Invalid argument',
201201
valueIsNull: 'Invalid argument',
202202
wrongTypeIn: 'A string was expected',
203-
bufAndOutLengthIsNull: 'Invalid argument'
203+
bufAndOutLengthIsNull: 'Invalid argument',
204204
});
205205

206206
assert.deepStrictEqual(test.testNull.getValueStringLatin1(), {
207207
envIsNull: 'Invalid argument',
208208
valueIsNull: 'Invalid argument',
209209
wrongTypeIn: 'A string was expected',
210-
bufAndOutLengthIsNull: 'Invalid argument'
210+
bufAndOutLengthIsNull: 'Invalid argument',
211211
});
212212

213213
assert.deepStrictEqual(test.testNull.getValueStringUtf16(), {
214214
envIsNull: 'Invalid argument',
215215
valueIsNull: 'Invalid argument',
216216
wrongTypeIn: 'A string was expected',
217-
bufAndOutLengthIsNull: 'Invalid argument'
217+
bufAndOutLengthIsNull: 'Invalid argument',
218218
});
Collapse file

‎test/js-native-api/test_error/test.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_error/test.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,35 +70,35 @@ assert.throws(() => {
7070
(err) => {
7171
assert.strictEqual(err, value);
7272
return true;
73-
}
73+
},
7474
));
7575

7676
assert.throws(
7777
() => test_error.throwErrorCode(),
7878
{
7979
code: 'ERR_TEST_CODE',
80-
message: 'Error [error]'
80+
message: 'Error [error]',
8181
});
8282

8383
assert.throws(
8484
() => test_error.throwRangeErrorCode(),
8585
{
8686
code: 'ERR_TEST_CODE',
87-
message: 'RangeError [range error]'
87+
message: 'RangeError [range error]',
8888
});
8989

9090
assert.throws(
9191
() => test_error.throwTypeErrorCode(),
9292
{
9393
code: 'ERR_TEST_CODE',
94-
message: 'TypeError [type error]'
94+
message: 'TypeError [type error]',
9595
});
9696

9797
assert.throws(
9898
() => test_error.throwSyntaxErrorCode(),
9999
{
100100
code: 'ERR_TEST_CODE',
101-
message: 'SyntaxError [syntax error]'
101+
message: 'SyntaxError [syntax error]',
102102
});
103103

104104
let error = test_error.createError();
Collapse file

‎test/js-native-api/test_exception/test.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_exception/test.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const test_exception = (function() {
3131
// Test that the native side passes the exception through
3232
assert.throws(
3333
() => { test_exception.allowException(throwTheError); },
34-
(err) => err === theError
34+
(err) => err === theError,
3535
);
3636

3737
// Test that the exception thrown above was marked as pending
@@ -59,7 +59,7 @@ const test_exception = (function() {
5959
// Test that the native side passes the exception through
6060
assert.throws(
6161
() => { test_exception.constructAllowException(throwTheError); },
62-
(err) => err === theError
62+
(err) => err === theError,
6363
);
6464

6565
// Test that the exception thrown above was marked as pending
Collapse file

‎test/js-native-api/test_function/test.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_function/test.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ assert.deepStrictEqual(test_function.TestCreateFunctionParameters(), {
4040
envIsNull: 'Invalid argument',
4141
nameIsNull: 'napi_ok',
4242
cbIsNull: 'Invalid argument',
43-
resultIsNull: 'Invalid argument'
43+
resultIsNull: 'Invalid argument',
4444
});
4545

4646
assert.throws(
4747
() => test_function.TestBadReturnExceptionPending(),
4848
{
4949
code: 'throwing exception',
50-
name: 'Error'
51-
}
50+
name: 'Error',
51+
},
5252
);
Collapse file

‎test/js-native-api/test_general/testEnvCleanup.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_general/testEnvCleanup.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (process.argv[2] === 'child') {
1111
'simple wrap': 0,
1212
'wrap, removeWrap': 1,
1313
'first wrap': 2,
14-
'second wrap': 3
14+
'second wrap': 3,
1515
};
1616

1717
// We attach the three objects we will test to `module.exports` to ensure they
@@ -39,7 +39,7 @@ if (process.argv[2] === 'child') {
3939
const { spawnSync } = require('child_process');
4040

4141
const child = spawnSync(process.execPath, [__filename, 'child'], {
42-
stdio: [ process.stdin, 'pipe', process.stderr ]
42+
stdio: [ process.stdin, 'pipe', process.stderr ],
4343
});
4444

4545
// Grab the child's output and construct an object whose keys are the rows of
@@ -49,7 +49,7 @@ if (process.argv[2] === 'child') {
4949
child.stdout.toString().split(/\r\n|\r|\n/g).reduce((obj, item) =>
5050
Object.assign(obj, item ? { [item]: true } : {}), {}), {
5151
'finalize at env cleanup for simple wrap': true,
52-
'finalize at env cleanup for second wrap': true
52+
'finalize at env cleanup for second wrap': true,
5353
});
5454

5555
// Ensure that the child exited successfully.
Collapse file

‎test/js-native-api/test_general/testInstanceOf.js‎

Copy file name to clipboardExpand all lines: test/js-native-api/test_general/testInstanceOf.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ if (typeof Symbol !== 'undefined' && 'hasInstance' in Symbol &&
6161
function compareToNative(theObject, theConstructor) {
6262
assert.strictEqual(
6363
addon.doInstanceOf(theObject, theConstructor),
64-
(theObject instanceof theConstructor)
64+
(theObject instanceof theConstructor),
6565
);
6666
}
6767

6868
function MyClass() {}
6969
Object.defineProperty(MyClass, Symbol.hasInstance, {
7070
value: function(candidate) {
7171
return 'mark' in candidate;
72-
}
72+
},
7373
});
7474

7575
function MySubClass() {}

0 commit comments

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