4
4
# https://github.com/cypress-io/circleci-orb
5
5
cypress :
cypress-io/[email protected] # used to run e2e tests
6
6
node :
circleci/[email protected] # used to publish new NPM version
7
+ win : circleci/windows@2 # run a test job on Windows
7
8
8
9
jobs :
9
10
unit :
@@ -485,6 +486,42 @@ workflows:
485
486
../../node_modules/.bin/only-covered main.js
486
487
working_directory : examples/one-spec
487
488
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 start --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
+
488
525
- publish :
489
526
filters :
490
527
branches :
@@ -507,3 +544,4 @@ workflows:
507
544
- example-docker-paths
508
545
- example-use-webpack
509
546
- example-all-files
547
+ - Windows test
0 commit comments