Skip to content

Commit ff130ff

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Add Fantom integration test for HTMLCollection
Summary: Converts the HTMLCollection Jest tests to Fantom. toThrow(TypeError) replaced with toThrow() due to Fantom's limited Jest API. Changelog: [Internal] Differential Revision: D94887759
1 parent 2e3db25 commit ff130ff

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/react-native/src/private/webapis/dom/oldstylecollections/__tests__/HTMLCollection-test.js renamed to packages/react-native/src/private/webapis/dom/oldstylecollections/__tests__/HTMLCollection-itest.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* @format
99
*/
1010

11+
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
12+
1113
import {createHTMLCollection} from '../HTMLCollection';
1214

1315
describe('HTMLCollection', () => {
@@ -39,13 +41,13 @@ describe('HTMLCollection', () => {
3941

4042
expect(() => {
4143
collection[0] = 'replacement';
42-
}).toThrow(TypeError);
44+
}).toThrow();
4345
expect(collection[0]).toBe('a');
4446

4547
expect(() => {
4648
// $FlowExpectedError[cannot-write]
4749
collection.length = 100;
48-
}).toThrow(TypeError);
50+
}).toThrow();
4951
expect(collection.length).toBe(3);
5052
});
5153

0 commit comments

Comments
 (0)