Skip to content

Commit

Permalink
Enable back test-expo-web job (#464)
Browse files Browse the repository at this point in the history
* Enable back `test-expo-web` job

* Put back the missing `/`

* Increase timeouts

* Update `puppeteer`
  • Loading branch information
charpeni committed Dec 23, 2023
1 parent 6e73fd4 commit d90cbce
Show file tree
Hide file tree
Showing 8 changed files with 445 additions and 2,627 deletions.
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,6 @@ workflows:
requires:
- lint
- test-js
# - test-expo-web:
# matrix:
# parameters:
# expo-version: ['43', '44']
# requires:
# - lint
# - test-js
- test-hermes-ios:
matrix:
parameters:
Expand All @@ -359,3 +352,10 @@ workflows:
react-native-version: ['0.68']
requires:
- test-android-<< matrix.react-native-version >>
- test-expo-web:
matrix:
parameters:
expo-version: ['48']
requires:
- lint
- test-js
2 changes: 1 addition & 1 deletion platforms/detox/TestPolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function testCreateObjectURL() {
const PolyfillTests = () => (
<>
<Text testID="url-polyfill-version">
{global.REACT_NATIVE_URL_POLYFILL}
{global.REACT_NATIVE_URL_POLYFILL ?? 'react-native-url-polyfill is not detected'}
</Text>
<Text testID="url-test-1">{new URL('dev', 'https://google.dev').href}</Text>
<Text testID="url-test-2">
Expand Down
17 changes: 17 additions & 0 deletions platforms/expo/48/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'expect-puppeteer';

jest.setTimeout(30000);

describe('App', () => {
beforeEach(async () => {
await page.goto('http://localhost:19006');
await page.waitForSelector('#root');
});

// react-native-url-polyfill isn't applied on React Native Web
it('should not have REACT_NATIVE_URL_POLYFILL', async () => {
await expect(page).toMatchElement('div[data-testid="url-polyfill-version"]', {
text: 'react-native-url-polyfill is not detected',
});
});
});
8 changes: 8 additions & 0 deletions platforms/expo/48/jest-puppeteer.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('jest-environment-puppeteer').JestPuppeteerConfig} */
module.exports = {
server: {
command: "yarn web",
port: 19006,
launchTimeout: 30000,
},
};
7 changes: 0 additions & 7 deletions platforms/expo/48/jest-puppeteer.config.js

This file was deleted.

10 changes: 5 additions & 5 deletions platforms/expo/48/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"android": "expo run:android",
"ios": "expo run:ios",
"web": "NODE_OPTIONS=--openssl-legacy-provider expo start --web",
"test:web": "jest"
"test:web": "NODE_OPTIONS=--openssl-legacy-provider jest"
},
"dependencies": {
"expo": "~48.0.18",
Expand All @@ -24,13 +24,13 @@
"babel-loader": "^8.2.3",
"jest": "^29.5.0",
"jest-expo": "^48.0.2",
"jest-expo-puppeteer": "^1.4.4",
"puppeteer": "^20.7.4"
"jest-puppeteer": "^9.0.2",
"puppeteer": "^21.6.1"
},
"jest": {
"preset": "jest-expo-puppeteer",
"preset": "jest-puppeteer",
"projects": [
"../../jest-puppeteer"
"<rootDir>"
]
},
"private": true
Expand Down
Loading

0 comments on commit d90cbce

Please sign in to comment.