add a new test:match command script (#2470)

This commit is contained in:
Fred K. Schott 2022-01-26 22:05:03 -08:00 committed by GitHub
parent 205e9e462e
commit b088d81070
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View file

@ -54,9 +54,10 @@ DEBUG=vite:[name] astro dev # debug specific process, e.g. "vite:deps" or "vit
```shell ```shell
# run this in the top-level project root to run all tests # run this in the top-level project root to run all tests
yarn test yarn test
# run only a few tests, great for working on a single feature # run only a few tests, based on describe() or it() string match
# (example - `yarn test -g "RSS"` runs `astro-rss.test.js`) # great for development, and working on a single feature!
yarn test -g "$STRING_MATCH" # (example - `yarn test:match "RSS"` runs tests in `astro-rss.test.js`)
yarn test:match "$STRING_MATCH"
``` ```
### Other useful commands ### Other useful commands

View file

@ -12,6 +12,7 @@
"build:examples": "turbo run build --scope=docs --scope=\"@example/*\"", "build:examples": "turbo run build --scope=docs --scope=\"@example/*\"",
"dev": "turbo run dev --no-deps --no-cache --parallel --scope=astro --scope=create-astro --scope=\"@astrojs/*\"", "dev": "turbo run dev --no-deps --no-cache --parallel --scope=astro --scope=create-astro --scope=\"@astrojs/*\"",
"test": "turbo run test --scope=astro", "test": "turbo run test --scope=astro",
"test:match": "cd packages/astro && yarn run test:match",
"test:templates": "turbo run test --scope=create-astro", "test:templates": "turbo run test --scope=create-astro",
"benchmark": "turbo run benchmark --scope=astro", "benchmark": "turbo run benchmark --scope=astro",
"lint": "eslint \"packages/**/*.ts\"", "lint": "eslint \"packages/**/*.ts\"",

View file

@ -51,7 +51,8 @@
"dev": "astro-scripts dev \"src/**/*.ts\"", "dev": "astro-scripts dev \"src/**/*.ts\"",
"postbuild": "astro-scripts copy \"src/**/*.astro\"", "postbuild": "astro-scripts copy \"src/**/*.astro\"",
"benchmark": "node test/benchmark/dev.bench.js && node test/benchmark/build.bench.js", "benchmark": "node test/benchmark/dev.bench.js && node test/benchmark/build.bench.js",
"test": "mocha --parallel --timeout 15000 --ignore **/lit-element.test.js && mocha **/lit-element.test.js" "test": "mocha --parallel --timeout 15000 --ignore **/lit-element.test.js && mocha **/lit-element.test.js",
"test:match": "mocha --timeout 15000 -g"
}, },
"dependencies": { "dependencies": {
"@astrojs/compiler": "^0.9.2", "@astrojs/compiler": "^0.9.2",