Skip to content

Commit 3798ff4

Browse files
committed
[Tests] handle ported test failures in iojs v2
1 parent e02cadb commit 3798ff4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@ljharb/eslint-config": "^21.1.0",
3333
"aud": "^2.0.3",
3434
"auto-changelog": "^2.4.0",
35+
"define-data-property": "^1.1.1",
3536
"eslint": "=8.8.0",
3637
"has-typed-arrays": "^1.0.1",
3738
"in-publish": "^2.0.1",

test/cmp.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var keys = require('object-keys');
1111
var availableTypedArrays = require('available-typed-arrays')();
1212
var forEach = require('for-each');
1313
var hasProto = require('has-proto')();
14+
var defineDataProperty = require('define-data-property');
1415

1516
var safeBuffer = typeof Buffer === 'function' ? Buffer.from && Buffer.from.length > 1 ? Buffer.from : Buffer : null;
1617
var buffersAreTypedArrays = typeof Buffer === 'function' && new Buffer(0) instanceof Uint8Array;
@@ -1201,13 +1202,14 @@ test('TypedArrays', { skip: !hasTypedArrays }, function (t) {
12011202
var a = new Uint8Array(10);
12021203
var b = tag(new Int8Array(10), 'Uint8Array');
12031204
b.__proto__ = Uint8Array.prototype; // eslint-disable-line no-proto
1205+
defineDataProperty(b, 'length', 10);
12041206

12051207
st.deepEqualTest(
12061208
a,
12071209
b,
12081210
'Uint8Array, and Int8Array pretending to be a Uint8Array',
1209-
true,
1210-
true
1211+
false,
1212+
false
12111213
);
12121214

12131215
st.end();

0 commit comments

Comments
 (0)