Skip to content

Commit a080bac

Browse files
committed
test(cli): introduce snapshot-based testing
- Implement basic snapshot matching in a helper file that can be later extracted into a standalone package - Add few more test helpers specific for our CLI package - Rework some of the integration tests for "controller" and "datasource" commands to use snapshots instead of regular expressions Signed-off-by: Miroslav Bajtoš <[email protected]>
1 parent 4e9611d commit a080bac

9 files changed

+866
-192
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/docs/apidocs
44
/docs/site/apidocs
55
packages/cli/generators/*/templates
6+
packages/cli/snapshots/
67
packages/tsdocs/fixtures/monorepo/docs
78
packages/tsdocs/fixtures/monorepo/**/dist
89
packages/tsdocs/fixtures/monorepo/**/docs

packages/cli/package-lock.json

+32-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
"json5": "^2.1.0",
5252
"lodash": "^4.17.15",
5353
"minimist": "^1.2.0",
54+
"mkdirp": "^0.5.1",
55+
"natural-compare": "^1.4.0",
5456
"pacote": "^9.5.8",
5557
"pluralize": "^8.0.0",
5658
"regenerate": "^1.4.0",
@@ -66,6 +68,7 @@
6668
"update-notifier": "^3.0.1",
6769
"url-slug": "^2.2.0",
6870
"validate-npm-package-name": "^3.0.0",
71+
"write-file-atomic": "^3.0.0",
6972
"yeoman-generator": "^4.0.2"
7073
},
7174
"scripts": {

0 commit comments

Comments
 (0)