Skip to content

Commit b9c5658

Browse files
docs: explained setup:test (#391)
## PR Checklist - [x] Addresses an existing open issue: fixes #278 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Adds a testing docs section for `setup:test`, which is then also removed as part of setup. Is there anything else you'd suggest I document @emday4prez?
1 parent e396907 commit b9c5658

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/DEVELOPMENT.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,19 @@ Calls to `console.log`, `console.warn`, and other console methods will cause a t
6666

6767
This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests.
6868
To launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5).
69+
70+
### Testing the Setup Script
71+
72+
In addition to unit tests, this template also includes an "end-to-end" test for `script/setup.js`.
73+
You can run it locally on the command-line:
74+
75+
```shell
76+
pnpm run setup:test
77+
```
78+
79+
That end-to-end test executes `script/setup-test-e2e.js`, which:
80+
81+
1. Runs the setup script using `--skip-api`
82+
2. Checks that the local repository's files were changed correctly (e.g. removed setup-only files)
83+
84+
As with the setup script itself, end-to-end tests are removed on package setup.

script/setup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ try {
373373
"./package.json",
374374
],
375375
[/## Explainer.*## Usage/gs, `## Usage`, "./README.md"],
376+
[/\n### Testing the Setup Script.*$/gs, "", "./.github/DEVELOPMENT.md"],
376377
[
377378
`["src/index.ts!", "script/setup*.js"]`,
378379
`"src/index.ts!"`,

0 commit comments

Comments
 (0)