Skip to content

Commit d90cbce

Browse files
authored
Enable back test-expo-web job (#464)
* Enable back `test-expo-web` job * Put back the missing `/` * Increase timeouts * Update `puppeteer`
1 parent 6e73fd4 commit d90cbce

File tree

8 files changed

+445
-2627
lines changed

8 files changed

+445
-2627
lines changed

.circleci/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,6 @@ workflows:
340340
requires:
341341
- lint
342342
- test-js
343-
# - test-expo-web:
344-
# matrix:
345-
# parameters:
346-
# expo-version: ['43', '44']
347-
# requires:
348-
# - lint
349-
# - test-js
350343
- test-hermes-ios:
351344
matrix:
352345
parameters:
@@ -359,3 +352,10 @@ workflows:
359352
react-native-version: ['0.68']
360353
requires:
361354
- test-android-<< matrix.react-native-version >>
355+
- test-expo-web:
356+
matrix:
357+
parameters:
358+
expo-version: ['48']
359+
requires:
360+
- lint
361+
- test-js

platforms/detox/TestPolyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function testCreateObjectURL() {
2222
const PolyfillTests = () => (
2323
<>
2424
<Text testID="url-polyfill-version">
25-
{global.REACT_NATIVE_URL_POLYFILL}
25+
{global.REACT_NATIVE_URL_POLYFILL ?? 'react-native-url-polyfill is not detected'}
2626
</Text>
2727
<Text testID="url-test-1">{new URL('dev', 'https://google.dev').href}</Text>
2828
<Text testID="url-test-2">

platforms/expo/48/App.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import 'expect-puppeteer';
2+
3+
jest.setTimeout(30000);
4+
5+
describe('App', () => {
6+
beforeEach(async () => {
7+
await page.goto('http://localhost:19006');
8+
await page.waitForSelector('#root');
9+
});
10+
11+
// react-native-url-polyfill isn't applied on React Native Web
12+
it('should not have REACT_NATIVE_URL_POLYFILL', async () => {
13+
await expect(page).toMatchElement('div[data-testid="url-polyfill-version"]', {
14+
text: 'react-native-url-polyfill is not detected',
15+
});
16+
});
17+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('jest-environment-puppeteer').JestPuppeteerConfig} */
2+
module.exports = {
3+
server: {
4+
command: "yarn web",
5+
port: 19006,
6+
launchTimeout: 30000,
7+
},
8+
};

platforms/expo/48/jest-puppeteer.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

platforms/expo/48/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"android": "expo run:android",
88
"ios": "expo run:ios",
99
"web": "NODE_OPTIONS=--openssl-legacy-provider expo start --web",
10-
"test:web": "jest"
10+
"test:web": "NODE_OPTIONS=--openssl-legacy-provider jest"
1111
},
1212
"dependencies": {
1313
"expo": "~48.0.18",
@@ -24,13 +24,13 @@
2424
"babel-loader": "^8.2.3",
2525
"jest": "^29.5.0",
2626
"jest-expo": "^48.0.2",
27-
"jest-expo-puppeteer": "^1.4.4",
28-
"puppeteer": "^20.7.4"
27+
"jest-puppeteer": "^9.0.2",
28+
"puppeteer": "^21.6.1"
2929
},
3030
"jest": {
31-
"preset": "jest-expo-puppeteer",
31+
"preset": "jest-puppeteer",
3232
"projects": [
33-
"../../jest-puppeteer"
33+
"<rootDir>"
3434
]
3535
},
3636
"private": true

0 commit comments

Comments
 (0)