diff --git a/.circleci/config.yml b/.circleci/config.yml index fe8958c5..35134092 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,10 @@ # https://circleci.com/docs/2.0/configuration-reference/ version: 2.1 orbs: - cypress: cypress-io/cypress@1.19.2 # used to run e2e tests + # https://github.com/cypress-io/circleci-orb + cypress: cypress-io/cypress@1.26.0 # used to run e2e tests node: circleci/node@1.1.6 # used to publish new NPM version + win: circleci/windows@2 # run a test job on Windows jobs: unit: @@ -484,6 +486,42 @@ workflows: ../../node_modules/.bin/only-covered main.js working_directory: examples/one-spec + - cypress/run: + name: Windows test + executor: + # executor comes from the "windows" orb + name: win/default + shell: bash.exe + no-workspace: true + start: npm run start:windows --prefix examples/all-files + wait-on: 'http://localhost:1234' + command: npx cypress run --project examples/all-files + # store screenshots and videos + store_artifacts: true + post-steps: + - run: cat examples/all-files/.nyc_output/out.json + - run: cat examples/all-files/coverage/coverage-final.json + # store the created coverage report folder + # you can click on it in the CircleCI UI + # to see live static HTML site + - store_artifacts: + path: examples/all-files/coverage + # make sure the examples captures 100% of code + - run: + command: npx nyc report --check-coverage true --lines 100 + working_directory: examples/all-files + - run: + name: Check code coverage 📈 + # we will check the final coverage report + # to make sure it only has files we are interested in + # because there are files covered at 0 in the report + command: | + ../../node_modules/.bin/check-coverage main.js + ../../node_modules/.bin/check-coverage second.js + ../../node_modules/.bin/check-coverage not-covered.js + ../../node_modules/.bin/only-covered --from coverage/coverage-final.json main.js second.js not-covered.js + working_directory: examples/all-files + - publish: filters: branches: @@ -506,3 +544,4 @@ workflows: - example-docker-paths - example-use-webpack - example-all-files + - Windows test diff --git a/examples/all-files/package.json b/examples/all-files/package.json index 59c6d0a8..497422d3 100644 --- a/examples/all-files/package.json +++ b/examples/all-files/package.json @@ -3,6 +3,7 @@ "description": "Report all files", "scripts": { "start": "../../node_modules/.bin/parcel serve index.html", + "start:windows": "npx bin-up parcel serve index.html", "cy:open": "../../node_modules/.bin/cypress open", "cy:run": "../../node_modules/.bin/cypress run", "dev": "../../node_modules/.bin/start-test 1234 cy:open",