Skip to content

Commit 548c2a9

Browse files
committed
Add better commenting regrding test removals
1 parent 759faf8 commit 548c2a9

7 files changed

+31
-5
lines changed

test/parallel/test-assert-async.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
// Currently in sync with Node.js test/parallel/test-assert-async.js
22
// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b
33

4+
// [browserify]
5+
// Most `err.message` and `err.stack` tests are commented out because they are
6+
// inconsistent between browsers.
7+
//
8+
// `err.operator` tests are commented out because its always `undefined` in IE.
9+
// If we drop IE support we can uncomment these tests.
10+
411
'use strict';
512
const common = require('../common');
613
const assert = require('../../assert');
@@ -78,7 +85,6 @@ const invalidThenableFunc = () => {
7885
assert.strictEqual(err.code, 'ERR_ASSERTION');
7986
// assert.strictEqual(err.message,
8087
// 'Missing expected rejection (mustNotCall).');
81-
// [browserify] This will be undefined in IE
8288
// assert.strictEqual(err.operator, 'rejects');
8389
assert.ok(!common.includes(err.stack, 'at Function.rejects'));
8490
return true;
@@ -202,7 +208,6 @@ promises.push(assert.rejects(
202208
assert.strictEqual(err.code, 'ERR_ASSERTION');
203209
assert.strictEqual(err.actual, actual);
204210
// assert.strictEqual(err.operator, 'rejects');
205-
// [browserify] Don't worry if the stack is less reliable
206211
// assert(/rejects/.test(err.stack));
207212
return true;
208213
};

test/parallel/test-assert-checktag.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Currently in sync with Node.js test/parallel/test-assert-checktag.js
22
// https://github.com/nodejs/node/commit/7493db21b667ed746d39c9b54357eac4287232e3
33

4+
// [browserify]
5+
// Most `err.message` tests are commented out because they are
6+
// inconsistent between browsers.
7+
48
'use strict';
59
const {isBrowser} = require('../common');
610
const assert = require('../../assert');

test/parallel/test-assert-deep.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Currently in sync with Node.js test/parallel/test-assert-deep.js
22
// https://github.com/nodejs/node/commit/1ed3c54ecbd72a33693e5954f86bcc9fd9b1cc09
33

4+
// [browserify]
5+
// Most `err.message` tests are commented out because they are
6+
// inconsistent between browsers.
7+
48
'use strict';
59

610
const common = require('../common');
@@ -965,8 +969,7 @@ assert.deepStrictEqual(obj1, obj2);
965969
util.inspect.defaultOptions = tmp;
966970
}
967971

968-
// [browserify] Safari fails this test. I'm not sure why, Chrome and Firefox pass.
969-
// @BridgeAR is it ok to comment out this test?
972+
// [browserify] Safari fails this test due to the proxy. Chrome and Firefox pass.
970973
// const invalidTrap = new Proxy([1, 2, 3], {
971974
// ownKeys() { return []; }
972975
// });

test/parallel/test-assert-if-error.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Currently in sync with Node.js test/parallel/test-assert-if-error.js
22
// https://github.com/nodejs/node/commit/644fdd60d4be49ffa66d0bda1702c4459f607635
33

4+
// [browserify]
5+
// Most `err.message` and `err.stack` tests are commented out because they are
6+
// inconsistent between browsers.
7+
48
'use strict';
59

610
require('../common');
@@ -86,7 +90,6 @@ assert.ifError(undefined);
8690
} catch (e) {
8791
threw = true;
8892
assert.strictEqual(e.message, 'Missing expected exception.');
89-
// [browserify] Don't worry if stack is missing info
9093
// assert(!e.stack.includes('throws'), e.stack);
9194
}
9295
assert(threw);

test/parallel/test-assert.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2424
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2525

26+
// [browserify]
27+
// Most `err.message` and `err.stack` tests are commented out because they are
28+
// inconsistent between browsers.
29+
//
30+
// `err.operator` tests are commented out because its always `undefined` in IE.
31+
// If we drop IE support we can uncomment these tests.
32+
2633
'use strict';
2734

2835
const arrayFill = require('array-fill');

test/pseudo-tty/test-assert-colors.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ try {
2424
'\u001b[34m...\u001b[39m\n' +
2525
' 2\n' +
2626
' ]';
27+
// [browserify]
28+
// Don't test the exact message, it's inconstent between browsers.
2729
// assert.strictEqual(err.message, expected);
2830
if(process.stderr && process.stderr.getColorDepth) {
2931
assert(err.message.indexOf('[32m') > -1);

test/pseudo-tty/test-assert-no-color.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ try {
1818
'- {\n' +
1919
'- foo: \'bar\'\n' +
2020
'- }';
21+
// [browserify]
22+
// Don't test the exact message, it's inconstent between browsers.
2123
// assert.strictEqual(error.message, expected);
2224
assert(error.message.indexOf('[32m') === -1);
2325
}

0 commit comments

Comments
 (0)