[build] command = "npm run build" publish = "build" base = "tests/routing" [build.environment] # cache Cypress binary in local "node_modules" folder # so Netlify caches it CYPRESS_CACHE_FOLDER = "./node_modules/CypressBinary" # set TERM variable for terminal output TERM = "xterm" # do not print too many progress messages CI = "1" [[plugins]] # local Cypress plugin will test our site after it is built # in production, please use: package = "netlify-plugin-cypress" package = "../../" # run Cypress tests once on the site before it is built # and then after building the static folder [plugins.inputs] # these settings apply to the default step onSuccess # in this case, we do not want to run any tests after deploy enable = false # let's run tests against development server # before building it (and testing the built site) [plugins.inputs.preBuild] enable = true start = 'npm start' wait-on = 'http://localhost:3000' wait-on-timeout = '45' # seconds # and test the built site after [plugins.inputs.postBuild] enable = true # must allow our test server to redirect unknown routes to "/" # so that client-side routing can correctly route them # can be set to true or "index.html" (or similar fallback filename in the built folder) spa = true