Skip to content

Commit 6c839b2

Browse files
committed
sync some tests between global and pure versions
1 parent 3d599b6 commit 6c839b2

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

tests/unit-global/es.regexp.escape.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ QUnit.test('RegExp.escape', assert => {
2121
'whitespaces and control',
2222
);
2323

24+
assert.same(escape('💩'), '💩', '💩');
25+
assert.same(escape('\uD83D'), '\\ud83d', '\\ud83d');
26+
assert.same(escape('\uDCA9'), '\\udca9', '\\udca9');
27+
assert.same(escape('\uDCA9\uD83D'), '\\udca9\\ud83d', '\\udca9\\ud83d');
28+
2429
assert.throws(() => escape(42), TypeError, 'throws on non-string #1');
2530
assert.throws(() => escape({}), TypeError, 'throws on non-string #2');
2631

tests/unit-pure/es.array.find-index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ QUnit.test('Array#findIndex', assert => {
1313
assert.same(that, array);
1414
}, context);
1515
assert.same(findIndex([1, 3, NaN, 42, {}], it => it === 42), 3);
16+
assert.same(findIndex([1, 3, NaN, 42, {}], it => it === 43), -1);
1617
if (STRICT) {
1718
assert.throws(() => findIndex(null, 0), TypeError);
1819
assert.throws(() => findIndex(undefined, 0), TypeError);

tests/unit-pure/es.array.flat-map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ QUnit.test('Array#flatMap', assert => {
1616
assert.same(index, 0);
1717
assert.same(that, array);
1818
assert.same(this, context);
19+
return value;
1920
}, context);
2021
if (STRICT) {
2122
assert.throws(() => flatMap(null, it => it), TypeError);

tests/unit-pure/esnext.array.filter-reject.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ QUnit.test('Array#filterReject', assert => {
1919
assert.throws(() => filterReject(null, () => { /* empty */ }), TypeError);
2020
assert.throws(() => filterReject(undefined, () => { /* empty */ }), TypeError);
2121
}
22+
assert.notThrows(() => filterReject({ length: -1, 0: 1 }, () => {
23+
throw new Error();
24+
}), 'uses ToLength');
2225
array = [];
2326
// eslint-disable-next-line object-shorthand -- constructor
2427
array.constructor = { [Symbol.species]: function () {

0 commit comments

Comments
 (0)