Skip to content

Commit 49ac2a4

Browse files
committed
updating references of examples to test-apps
1 parent 8a9dbc7 commit 49ac2a4

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

.circleci/config.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ jobs:
4747
at: ~/
4848
- run:
4949
command: npm run test
50-
working_directory: examples/<< parameters.jobname >>
50+
working_directory: test-apps/<< parameters.jobname >>
5151
- store_artifacts:
52-
path: examples/<< parameters.jobname >>/coverage
52+
path: test-apps/<< parameters.jobname >>/coverage
5353
- run:
5454
name: Verify Code Coverage
5555
command: npm run coverage:verify
56-
working_directory: examples/<< parameters.jobname >>
56+
working_directory: test-apps/<< parameters.jobname >>
5757
- run:
5858
name: Check code coverage files 📈
5959
# we will check the final coverage report
6060
# to make sure it only has files we are interested in
6161
# because there are files covered at 0 in the report
6262
command: npm run coverage:check-files
63-
working_directory: examples/<< parameters.jobname >>
63+
working_directory: test-apps/<< parameters.jobname >>
6464

6565
test-code-coverage-plugin:
6666
docker:
@@ -86,13 +86,13 @@ workflows:
8686
- run: npm i -g npm@latest
8787
post-install:
8888
- run:
89-
name: Install deps for examples/old-cypress-config
89+
name: Install deps for test-apps/old-cypress-config
9090
command: npm ci
91-
working_directory: examples/old-cypress-config
91+
working_directory: test-apps/old-cypress-config
9292
- run:
93-
name: Install deps for examples/new-cypress-config
93+
name: Install deps for test-apps/new-cypress-config
9494
command: npm ci
95-
working_directory: examples/new-cypress-config
95+
working_directory: test-apps/new-cypress-config
9696
post-steps:
9797
- run: npm run check:markdown
9898

@@ -145,23 +145,23 @@ workflows:
145145
# name: win/default
146146
# shell: bash.exe
147147
# no-workspace: true
148-
# start: npm run start:windows --prefix examples/old-cypress-config/all-files
148+
# start: npm run start:windows --prefix test-apps/old-cypress-config/all-files
149149
# wait-on: 'http://localhost:1234'
150150
# command: ../node_modules/.bin/cypress run
151151
# # store screenshots and videos
152152
# store_artifacts: true
153153
# post-steps:
154-
# - run: cat examples/old-cypress-config/all-files/.nyc_output/out.json
155-
# - run: cat examples/old-cypress-config/all-files/coverage/coverage-final.json
154+
# - run: cat test-apps/old-cypress-config/all-files/.nyc_output/out.json
155+
# - run: cat test-apps/old-cypress-config/all-files/coverage/coverage-final.json
156156
# # store the created coverage report folder
157157
# # you can click on it in the CircleCI UI
158158
# # to see live static HTML site
159159
# - store_artifacts:
160-
# path: examples/old-cypress-config/all-files/coverage
161-
# # make sure the examples captures 100% of code
160+
# path: test-apps/old-cypress-config/all-files/coverage
161+
# # make sure the test-apps captures 100% of code
162162
# - run:
163163
# command: npx nyc report --check-coverage true --lines 100
164-
# working_directory: examples/old-cypress-config/all-files
164+
# working_directory: test-apps/old-cypress-config/all-files
165165
# - run:
166166
# name: Check code coverage 📈
167167
# # we will check the final coverage report
@@ -172,7 +172,7 @@ workflows:
172172
# ../../node_modules/.bin/check-coverage second.js
173173
# ../../node_modules/.bin/check-coverage not-covered.js
174174
# ../../node_modules/.bin/only-covered --from coverage/coverage-final.json main.js second.js not-covered.js
175-
# working_directory: examples/old-cypress-config/all-files
175+
# working_directory: test-apps/old-cypress-config/all-files
176176

177177
# - publish:
178178
# filters:

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This plugin **DOES NOT** instrument your code. You have to instrument it yoursel
4040
}
4141
```
4242

43-
Please see the [Examples](#examples) section down below, you can probably find a linked project matching your situation to see how to instrument your application's source code before running end-to-end tests to get the code coverage.
43+
Please see the [Test Apps](#test-apps) section down below, you can probably find a linked project matching your situation to see how to instrument your application's source code before running end-to-end tests to get the code coverage.
4444

4545
If your application has been instrumented correctly, then you should see additional counters and instructions in the application's JavaScript resources, like the image down below shows.
4646

@@ -66,7 +66,7 @@ That should be it! You should see messages from this plugin in the Cypress Comma
6666

6767
### App vs unit tests
6868

69-
You need to instrument your web application. This means that when the test does `cy.visit('localhost:3000')` any code the `index.html` requests should be instrumented by YOU. See [Examples](#examples) section for advice, usually you need to stick `babel-plugin-istanbul` into your pipeline somewhere.
69+
You need to instrument your web application. This means that when the test does `cy.visit('localhost:3000')` any code the `index.html` requests should be instrumented by YOU. See [Test Apps](#test-apps) section for advice, usually you need to stick `babel-plugin-istanbul` into your pipeline somewhere.
7070

7171
If you are testing individual functions from your application code by importing them directly into Cypress spec files, this is called "unit tests" and Cypress can instrument this scenario for you. See [Instrument unit tests](#instrument-unit-tests) section.
7272

@@ -136,7 +136,7 @@ module.exports = (on, config) => {
136136

137137
Now the code coverage from spec files will be combined with end-to-end coverage.
138138

139-
Find example of a just the unit tests and JavaScript source files with collected code coverage in [examples/unit-tests-js](./examples/unit-tests-js).
139+
Find example of a just the unit tests and JavaScript source files with collected code coverage in [test-apps/new-cypress-config/unit-tests-js](./test-apps/new-cypress-config/unit-tests-js).
140140

141141
### Alternative for unit tests
142142

@@ -155,7 +155,7 @@ module.exports = (on, config) => {
155155

156156
## Instrument backend code
157157

158-
Example in [examples/backend](examples/backend) folder.
158+
Example in [test-apps/new-cypress-config/backend](test-apps/backend) folder.
159159

160160
You can also instrument your server-side code and produce combined coverage report that covers both the backend and frontend code
161161

@@ -275,7 +275,7 @@ Sometimes NYC tool might be installed in a different folder not in the current o
275275

276276
TypeScript source files should be automatically included in the report, if they are instrumented.
277277

278-
See [examples/ts-example](examples/ts-example), [bahmutov/cra-ts-code-coverage-example](https://github.com/bahmutov/cra-ts-code-coverage-example) or [bahmutov/cypress-angular-coverage-example](https://github.com/bahmutov/cypress-angular-coverage-example).
278+
See [test-apps/new-cypress-config/ts-example](test-apps/ts-example), [bahmutov/cra-ts-code-coverage-example](https://github.com/bahmutov/cra-ts-code-coverage-example) or [bahmutov/cypress-angular-coverage-example](https://github.com/bahmutov/cypress-angular-coverage-example).
279279

280280
## Include code
281281

@@ -292,7 +292,7 @@ For example, if you want to make sure the final report includes all JS files fro
292292
}
293293
```
294294

295-
See example [examples/all-files](./examples/all-files)
295+
See example [test-app/all-files](./test-apps/new-cypress-config/all-files)
296296

297297
## Exclude code
298298

@@ -363,7 +363,7 @@ For example, if you want to only include files in the `app` folder, but exclude
363363

364364
**Note:** if you have `all: true` NYC option set, this plugin will check the produced `.nyc_output/out.json` before generating the final report. If the `out.json` file does not have information for some files that should be there according to `include` list, then an empty placeholder will be included, see [PR 208](https://github.com/cypress-io/code-coverage/pull/208).
365365

366-
Another important option is `excludeAfterRemap`. By default it is false, which might let excluded files through. If you are excluding the files, and the instrumenter does not respect the `nyc.exclude` setting, then add `excludeAfterRemap: true` to tell `nyc report` to exclude files. See [examples/exclude-files](examples/exclude-files).
366+
Another important option is `excludeAfterRemap`. By default it is false, which might let excluded files through. If you are excluding the files, and the instrumenter does not respect the `nyc.exclude` setting, then add `excludeAfterRemap: true` to tell `nyc report` to exclude files. See [test-apps/exclude-files](test-apps/new-cypress-config/exclude-files).
367367

368368
## Disable plugin
369369

@@ -405,19 +405,19 @@ npm run dev:no:coverage
405405

406406
## Examples
407407

408-
### Internal examples
408+
### Internal test apps
409409

410410
Full examples we use for testing in this repository:
411411

412-
- [examples/backend](examples/backend) only instruments the backend Node server and saves the coverage report
413-
- [examples/fullstack](examples/fullstack) instruments and merges backend, e2e and unit test coverage into a single report
414-
- [examples/before-all-visit](examples/before-all-visit) checks if code coverage works when `cy.visit` is made once in the `before` hook
415-
- [examples/before-each-visit](examples/before-each-visit) checks if code coverage correctly keeps track of code when doing `cy.visit` before each test
416-
- [examples/one-spec.js](examples/one-spec.js) confirms that coverage is collected and filtered correctly if the user only executes a single Cypress test
417-
- [examples/ts-example](examples/ts-example) uses Babel + Parcel to instrument and serve TypeScript file
418-
- [examples/use-webpack](examples/use-webpack) shows Webpack build with source maps and Babel
419-
- [examples/unit-tests-js](examples/unit-tests-js) runs just the unit tests and reports code coverage (JavaScript source code)
420-
- [examples/unit-tests-ts](examples/unit-tests-ts) **NOT WORKING** runs just the unit tests and reports code coverage (TypeScript source code)
412+
- [test-apps/backend](test-apps/new-cypress-config/backend) only instruments the backend Node server and saves the coverage report
413+
- [test-apps/fullstack](test-apps/new-cypress-config/fullstack) instruments and merges backend, e2e and unit test coverage into a single report
414+
- [test-apps/before-all-visit](test-apps/new-cypress-config/before-all-visit) checks if code coverage works when `cy.visit` is made once in the `before` hook
415+
- [test-apps/before-each-visit](test-apps/new-cypress-config/before-each-visit) checks if code coverage correctly keeps track of code when doing `cy.visit` before each test
416+
- [test-apps/one-spec.js](test-apps/new-cypress-config/one-spec.js) confirms that coverage is collected and filtered correctly if the user only executes a single Cypress test
417+
- [test-apps/ts-example](test-apps/new-cypress-config/ts-example) uses Babel + Parcel to instrument and serve TypeScript file
418+
- [test-apps/use-webpack](test-apps/new-cypress-config/use-webpack) shows Webpack build with source maps and Babel
419+
- [test-apps/unit-tests-js](test-apps/new-cypress-config/unit-tests-js) runs just the unit tests and reports code coverage (JavaScript source code)
420+
- [test-apps/unit-tests-ts](test-apps/new-cypress-config/unit-tests-ts) **NOT WORKING** runs just the unit tests and reports code coverage (TypeScript source code)
421421

422422
### External examples
423423

@@ -472,7 +472,7 @@ module.exports = (on, config) => {
472472
}
473473
```
474474

475-
See [examples/use-plugins-and-support](examples/use-plugins-and-support)
475+
See [test-apps/use-plugins-and-support](test-apps/new-cypress-config/use-plugins-and-support)
476476

477477
## Debugging
478478

0 commit comments

Comments
 (0)