-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage-scripts.js
49 lines (48 loc) · 1.35 KB
/
package-scripts.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
const examples = [
'Basic',
'Request',
'Form',
'Subscription',
'ShadowDom',
];
const buildExample = name => [
`mkdir -p cypress/server/public/${name}`,
`cp examples/index.html cypress/server/public/${name}/`,
`browserify --entry=examples/${name}.bs.js --outfile=cypress/server/public/${name}/index.js`,
].join(' && ');
module.exports = {
scripts: {
default: 'bsb -make-world -w',
build: {
default: 'bsb -make-world',
examples: examples.map(buildExample).join(' && '),
},
test: {
default: 'jest __tests__ __tests__/**/*.bs.js',
e2e: {
script: `node cypress/server/main.js & ./node_modules/.bin/cypress run --spec 'cypress/integration/**'`
}
},
clean: {
default: 'yarn start clean.bs && yarn start clean.server',
bs: 'bsb -clean-world',
server: 'rm -rf cypress/server/public',
},
server: 'node cypress/server/main.js',
cy: {
default: './node_modules/.bin/cypress open',
run: `./node_modules/.bin/cypress run --spec 'cypress/integration/**'`,
ci: [
'yarn start build',
'yarn start build.examples',
'yarn start server & (sleep 5 && yarn start cy.run)',
].join(' && ')
},
ci: [
'yarn start clean',
'yarn start build',
'yarn start test',
'yarn start build.examples',
].join(' && ')
},
}