Skip to content

Commit 63de60b

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Add Fantom integration test for DOMRectList
Summary: Converts the DOMRectList Jest tests to Fantom. toThrow(TypeError) replaced with toThrow(). Changelog: [Internal] Differential Revision: D94887835
1 parent b91c312 commit 63de60b

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

packages/react-native/src/private/webapis/geometry/__tests__/DOMRectList-test.js renamed to packages/react-native/src/private/webapis/geometry/__tests__/DOMRectList-itest.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
* @format
99
*/
1010

11+
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
12+
1113
import {createDOMRectList} from '../DOMRectList';
1214
import DOMRectReadOnly from '../DOMRectReadOnly';
1315

14-
const domRectA = new DOMRectReadOnly();
15-
const domRectB = new DOMRectReadOnly();
16-
const domRectC = new DOMRectReadOnly();
16+
const domRectA = new DOMRectReadOnly(1, 2, 3, 4);
17+
const domRectB = new DOMRectReadOnly(5, 6, 7, 8);
18+
const domRectC = new DOMRectReadOnly(9, 10, 11, 12);
1719

1820
describe('DOMRectList', () => {
1921
it('provides an array-like interface', () => {
@@ -44,13 +46,13 @@ describe('DOMRectList', () => {
4446

4547
expect(() => {
4648
collection[0] = new DOMRectReadOnly();
47-
}).toThrow(TypeError);
49+
}).toThrow();
4850
expect(collection[0]).toBe(domRectA);
4951

5052
expect(() => {
5153
// $FlowExpectedError[cannot-write]
5254
collection.length = 100;
53-
}).toThrow(TypeError);
55+
}).toThrow();
5456
expect(collection.length).toBe(3);
5557
});
5658

0 commit comments

Comments
 (0)