forked from expo/expo-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest-puppeteer.config.js
96 lines (92 loc) · 2.48 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* 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 tests/basic/ --web-only --non-interactive --https`,
port: 5000,
launchTimeout: 30000,
debug: true,
},
},
build: {
url: 'http://localhost:5000',
launch,
server: {
command: process.env.EXPO_E2E_SKIP_BUILD
? `serve tests/basic/web-build`
: `node jest/build-project.js tests/basic/ && serve tests/basic/web-build`,
// The default serve-cli port
port: 5000,
launchTimeout: 30000,
debug: true,
},
},
startNextJsFromExpoCLI: {
url: 'http://localhost:8000',
launch,
server: {
command: `../expo-cli/bin/expo.js start tests/nextjs/ --web-only --dev --non-interactive --no-https`,
port: 8000,
launchTimeout: 30000,
debug: true,
},
hasServerSideRendering: true,
},
buildNextJsFromExpoCLI: {
url: 'http://localhost:8000',
launch,
server: {
command: `../expo-cli/bin/expo.js start tests/nextjs/ --web-only --no-dev --non-interactive --no-https`,
port: 8000,
launchTimeout: 30000,
debug: true,
},
hasServerSideRendering: true,
},
startNextJsFromNextCLI: {
url: 'http://localhost:8000',
launch,
server: {
command: `cd tests/nextjs && yarn next dev -p 8000`,
port: 8000,
launchTimeout: 30000,
debug: true,
},
hasServerSideRendering: true,
},
buildNextJsFromNextCLI: {
url: 'http://localhost:8000',
launch,
server: {
command: `cd tests/nextjs && yarn next build && yarn next start -p 8000`,
port: 8000,
launchTimeout: 30000,
debug: true,
},
hasServerSideRendering: 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;