Skip to content

Instantly share code, notes, and snippets.

@dextel2
Created November 27, 2018 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dextel2/f52885e8a7a5d77ce56a30d1b10c8417 to your computer and use it in GitHub Desktop.
Save dextel2/f52885e8a7a5d77ce56a30d1b10c8417 to your computer and use it in GitHub Desktop.
A generic CI for GitLab CI, for ReactJS test cases, if you do not have separate client/server architecture you will not need 1st line of `script`,
image: node:8.11.3
test:
script:
- cd client && npm install
- CI=true npm test
only:
- master
# To manage things more clean you can create a folder inside src named `__tests__` and tests will work just fine
# File extension must be Filename.test.js
# Since JS is extension add `--env=jsdom` in test script in package.json
# Example : "test": "react-scripts test --env=jsdom"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment