11# https://circleci.com/docs/2.0/configuration-reference/
22version : 2.1
33orbs :
4- cypress : cypress-io/cypress@1.19.2 # used to run e2e tests
4+ # https://github.com/cypress-io/circleci-orb
5+ cypress : cypress-io/cypress@1.26.0 # used to run e2e tests
56 node : circleci/node@1.1.6 # used to publish new NPM version
7+ win : circleci/windows@2 # run a test job on Windows
68
79jobs :
810 unit :
@@ -484,6 +486,42 @@ workflows:
484486 ../../node_modules/.bin/only-covered main.js
485487 working_directory : examples/one-spec
486488
489+ - cypress/run :
490+ name : Windows test
491+ executor :
492+ # executor comes from the "windows" orb
493+ name : win/default
494+ shell : bash.exe
495+ no-workspace : true
496+ start : npm run start:windows --prefix examples/all-files
497+ wait-on : ' http://localhost:1234'
498+ command : npx cypress run --project examples/all-files
499+ # store screenshots and videos
500+ store_artifacts : true
501+ post-steps :
502+ - run : cat examples/all-files/.nyc_output/out.json
503+ - run : cat examples/all-files/coverage/coverage-final.json
504+ # store the created coverage report folder
505+ # you can click on it in the CircleCI UI
506+ # to see live static HTML site
507+ - store_artifacts :
508+ path : examples/all-files/coverage
509+ # make sure the examples captures 100% of code
510+ - run :
511+ command : npx nyc report --check-coverage true --lines 100
512+ working_directory : examples/all-files
513+ - run :
514+ name : Check code coverage 📈
515+ # we will check the final coverage report
516+ # to make sure it only has files we are interested in
517+ # because there are files covered at 0 in the report
518+ command : |
519+ ../../node_modules/.bin/check-coverage main.js
520+ ../../node_modules/.bin/check-coverage second.js
521+ ../../node_modules/.bin/check-coverage not-covered.js
522+ ../../node_modules/.bin/only-covered --from coverage/coverage-final.json main.js second.js not-covered.js
523+ working_directory : examples/all-files
524+
487525 - publish :
488526 filters :
489527 branches :
@@ -506,3 +544,4 @@ workflows:
506544 - example-docker-paths
507545 - example-use-webpack
508546 - example-all-files
547+ - Windows test
0 commit comments