forked from expo/expo-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest-puppeteer.config.js
52 lines (48 loc) · 1.34 KB
/
jest-puppeteer.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* eslint-env node */
const assert = require('assert');
const launch = process.env.CI
? {
args: ['--ignore-certificate-errors', '--no-sandbox', '--disable-setuid-sandbox'],
ignoreHTTPSErrors: true,
headless: true,
}
: {
args: ['--ignore-certificate-errors'],
ignoreHTTPSErrors: true,
headless: true,
};
const config = {
start: {
url: 'https://localhost:5000',
launch,
server: {
command: `../expo-cli/bin/expo.js start:web e2e/basic/ --non-interactive --https`,
port: 5000,
launchTimeout: 60000,
debug: true,
},
},
build: {
url: 'http://localhost:5000',
launch,
server: {
command: process.env.EXPO_E2E_SKIP_BUILD
? `serve e2e/basic/web-build`
: `node jest/build-project.js e2e/basic/ && serve e2e/basic/web-build`,
// The default serve-cli port
port: 5000,
launchTimeout: 60000,
debug: true,
},
},
}[process.env.EXPO_E2E_COMMAND];
assert(process.env.EXPO_E2E_COMMAND, `EXPO_E2E_COMMAND must be defined`);
assert(
config,
`"${process.env.EXPO_E2E_COMMAND}" is not a valid E2E test. Expected one of ${Object.keys(
config
).join(', ')}`
);
// Tell Expo CLI to use the same port on which the test runner expects there to be a server
process.env.WEB_PORT = config.server.port;
module.exports = config;