-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (26 loc) · 880 Bytes
/
index.js
File metadata and controls
33 lines (26 loc) · 880 Bytes
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
const runChildProcess = async (entryPoint) => {
require('tsx/cjs')
require(entryPoint)
}
const startCypress = async () => {
try {
const { initializeStartTime } = require('./lib/util/performance_benchmark')
initializeStartTime()
// No typescript requires before this point please
// typescript isn't interpreted until the start cypress file
// Avoid putting much code here all together since this is prior to v8 snapshots.
const { hookRequire } = require('./hook-require')
hookRequire({ forceTypeScript: false })
await require('./start-cypress')
} catch (error) {
// eslint-disable-next-line no-console
console.error(error)
process.exit(1)
}
}
const { entryPoint } = require('minimist')(process.argv.slice(1))
if (entryPoint) {
module.exports = runChildProcess(entryPoint)
} else {
module.exports = startCypress()
}