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