Skip to content

Commit

Permalink
fix some scripts to work with traviis
Browse files Browse the repository at this point in the history
add cypress run command
  • Loading branch information
MohammedYehia committed Sep 30, 2019
1 parent aef1217 commit 18c0d5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
19 changes: 9 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: node_js

node_js:
# Node 10.3+ includes npm@6 which has good "npm ci" command
- 10.8
- stable

# if using Ubuntu 16 need this library
# https://github.com/cypress-io/cypress-documentation/pull/1647
Expand All @@ -17,12 +17,11 @@ cache:
- ~/.npm
- ~/.cache

defaults: &defaults
script:
# ## print all Travis environment variables for debugging
- $(npm bin)/print-env TRAVIS
- npm start &
- npm run cypress
# after all tests finish running we need
# to kill all background jobs (like "npm start &")
- kill $(jobs -p) || true
script:
# ## print all Travis environment variables for debugging
- $(npm bin)/print-env TRAVIS
- npm start &
- npm run cy:run
# after all tests finish running we need
# to kill all background jobs (like "npm start &")
- kill $(jobs -p) || true
8 changes: 4 additions & 4 deletions cypress/integration/app.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe("First Test", () => {
it("App should have a class called App-header", () => {
cy.visit("/");
cy.get(".App-header").should("exist");
});
it("App should have a class called App-header", () => {
cy.visit("/");
cy.get(".App-header").should("exist");
});
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"cypress": "cypress open"
"cy:open": "cypress open",
"cy:run": "cypress run"
},
"eslintConfig": {
"extends": "react-app"
Expand Down

0 comments on commit 18c0d5b

Please sign in to comment.