Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 5ce6297

Browse files
committed
test: cleanup with upstream
Cleaned up a bunch of inconsistencies with the upstream tests. PR-URL: #365 Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
1 parent f11801b commit 5ce6297

27 files changed

+169
-168
lines changed

test/addons-napi/test_async/test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
const common = require('../../common');
33
const assert = require('assert');
44
const child_process = require('child_process');
5-
65
const test_async = require(`./build/${common.buildType}/test_async`);
76

87
const testException = 'test_async_cb_exception';

test/inspector/test-inspector.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ function checkVersion(err, response) {
2929
}
3030

3131
function checkBadPath(err, response) {
32-
assert(err instanceof SyntaxError, 'Expected SyntaxError');
32+
assert(err instanceof SyntaxError);
3333
assert(
3434
common.engineSpecificMessage({
3535
v8: /Unexpected token/,
3636
chakracore: /JSON\.parse Error: Invalid character at position:1/
37-
}).test(err.message),
38-
'Unexpected message: ' + err.message);
39-
assert(/WebSockets request was expected/.test(err.response),
40-
'Unexpected response: ' + err.response);
37+
}).test(err.message)
38+
);
39+
assert(/WebSockets request was expected/.test(err.response));
4140
}
4241

4342
function expectMainScriptSource(result) {

test/parallel/parallel.status

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ test-npm-install: PASS,FLAKY
1919

2020
[$system==freebsd]
2121

22-
# fs-watch currently needs special configuration on AIX and we
23-
# want to improve under https://github.com/nodejs/node/issues/5085.
24-
# Tests are disabled so CI can be green and we can spot other
25-
# regressions until this work is complete
26-
[$system==aix]
27-
test-fs-watch-enoent : FAIL, PASS
28-
test-fs-watch-encoding : FAIL, PASS
29-
3022
[$jsEngine==chakracore]
3123
test-assert-checktag : PASS,FLAKY
3224
test-async-hooks-disable-during-promise : PASS,FLAKY

test/parallel/test-buffer-slow.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ try {
3838
v8: 'Array buffer allocation failed',
3939
chakracore: 'Invalid offset/length when creating typed array'
4040
}));
41-
4241
}
4342

4443
// should work with number-coercible values

test/parallel/test-domain-abort-on-uncaught.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if (common.isChakraEngine) {
1515
'on v8-option --abort-on-uncaught-exception');
1616
return;
1717
}
18+
1819
const tests = [
1920
function nextTick() {
2021
const d = domain.create();

test/parallel/test-domain.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ d.on('error', function(er) {
5252

5353
const typeErrMsg = common.engineSpecificMessage({
5454
v8: "Cannot read property 'isDirectory' of undefined",
55-
chakracore: "Unable to get property 'isDirectory' of undefined or\
56-
null reference"
55+
chakracore: "Unable to get property 'isDirectory' of undefined or" +
56+
' null reference'
5757
});
5858

5959
switch (er_message) {

test/parallel/test-preload.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const assert = require('assert');
1313
const path = require('path');
1414
const childProcess = require('child_process');
1515

16-
1716
const nodeBinary = process.argv[0];
1817

1918
const preloadOption = (preloads) => {

test/parallel/test-querystring-escape.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,21 @@ assert.strictEqual(
2222
);
2323

2424
// toString is not callable, must throw an error
25-
assert.throws(() => qs.escape({toString: 5}),
26-
common.engineSpecificMessage({
27-
v8: /^TypeError: Cannot convert object to primitive value$/,
28-
chakracore: /^TypeError: String expected$/
29-
}));
25+
assert.throws(
26+
() => qs.escape({toString: 5}),
27+
common.engineSpecificMessage({
28+
v8: /^TypeError: Cannot convert object to primitive value$/,
29+
chakracore: /^TypeError: String expected$/
30+
})
31+
);
3032

3133
// should use valueOf instead of non-callable toString
3234
assert.strictEqual(qs.escape({toString: 5, valueOf: () => 'test'}), 'test');
3335

34-
const chakraSymbolTypeError =
35-
/^TypeError: Object doesn't support property or method 'ToString'$/;
36-
37-
assert.throws(() => qs.escape(Symbol('test')),
38-
common.engineSpecificMessage({
39-
v8: /^TypeError: Cannot convert a Symbol value to a string$/,
40-
chakracore: chakraSymbolTypeError
41-
}));
36+
assert.throws(
37+
() => qs.escape(Symbol('test')),
38+
common.engineSpecificMessage({
39+
v8: /^TypeError: Cannot convert a Symbol value to a string$/,
40+
chakracore: /^TypeError: Object doesn't support property or method 'ToString'$/
41+
})
42+
);

test/parallel/test-url-format-whatwg.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,20 @@ assert.strictEqual(
8585
'http://xn--lck1c3crb1723bpq4a.com/a?a=b#c'
8686
);
8787

88-
// Unicode conversion in node code is dependent on
89-
// v8's i18n support which is disabled for chakracore
90-
if (!common.isChakraEngine) {
91-
assert.strictEqual(
92-
url.format(myURL, { unicode: true }),
93-
'http://理容ナカムラ.com/a?a=b#c'
94-
);
95-
96-
assert.strictEqual(
97-
url.format(myURL, { unicode: 1 }),
98-
'http://理容ナカムラ.com/a?a=b#c'
99-
);
100-
101-
assert.strictEqual(
102-
url.format(myURL, { unicode: {} }),
103-
'http://理容ナカムラ.com/a?a=b#c'
104-
);
105-
}
88+
assert.strictEqual(
89+
url.format(myURL, { unicode: true }),
90+
'http://理容ナカムラ.com/a?a=b#c'
91+
);
92+
93+
assert.strictEqual(
94+
url.format(myURL, { unicode: 1 }),
95+
'http://理容ナカムラ.com/a?a=b#c'
96+
);
97+
98+
assert.strictEqual(
99+
url.format(myURL, { unicode: {} }),
100+
'http://理容ナカムラ.com/a?a=b#c'
101+
);
106102

107103
assert.strictEqual(
108104
url.format(myURL, { unicode: false }),

test/parallel/test-url-parse-invalid-input.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ const errMessage = /^TypeError: Parameter "url" must be a string, not (?:undefin
2020
assert.throws(() => { url.parse(val); }, errMessage);
2121
});
2222

23-
const engineSpecificMalformedUrlError =
24-
common.engineSpecificMessage({
25-
v8: /^URIError: URI malformed$/,
26-
chakracore: /^URIError: The URI to be decoded is not a valid encoding$/
27-
});
28-
29-
assert.throws(() => { url.parse('http://%E0%A4%A@fail'); }, engineSpecificMalformedUrlError);
23+
assert.throws(
24+
() => { url.parse('http://%E0%A4%A@fail'); },
25+
common.engineSpecificMessage({
26+
v8: /^URIError: URI malformed$/,
27+
chakracore: /^URIError: The URI to be decoded is not a valid encoding$/
28+
})
29+
);

0 commit comments

Comments
 (0)