Skip to content

Commit 9997873

Browse files
committed
update test-prebuild
1 parent fdaf721 commit 9997873

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

tests/test-prebuild-only/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# run pre-build tests only
2+
3+
These tests run:
4+
- [x] before the build
5+
- [ ] after the build
6+
- [ ] on deploy success
7+
8+
## Local build
9+
10+
Use command `DEBUG=netlify-plugin-cypress npm run netlify:build` to try the plugin locally

tests/test-prebuild-only/netlify.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ publish = "public"
88
CYPRESS_CACHE_FOLDER = "./node_modules/CypressBinary"
99
# set TERM variable for terminal output
1010
TERM = "xterm"
11+
# do not print too many progress messages
12+
CI = "1"
1113

1214
[[plugins]]
1315
# local Cypress plugin will test our site after it is built
@@ -17,12 +19,14 @@ TERM = "xterm"
1719
# run Cypress tests once on the site before it is built
1820
# and do not run the tests after it was built
1921

22+
[plugins.inputs]
23+
# these settings apply to the default step onSuccess
24+
# in this case, we do not want to run any tests after deploy
25+
enable = false
26+
2027
# let's run tests against development server
2128
[plugins.inputs.preBuild]
29+
enable = true
2230
start = 'npx serve public'
2331
wait-on = 'http://localhost:5000'
2432
wait-on-timeout = '30' # seconds
25-
26-
# and skip tests after building it
27-
[plugins.inputs]
28-
skip = true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "prebuild-only-example",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"netlify:build": "../../node_modules/.bin/netlify build"
7+
}
8+
}

0 commit comments

Comments
 (0)