aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-02-15 04:27:08 +0100
committerGitHub <noreply@github.com>2024-02-15 03:27:08 +0000
commit4cc2fc76138212883b047a17a78e4f83266c0f1c (patch)
tree6a59c44724d082de81f439d04a11c867831877c4
parent6bf7b0055765c4f2011c9614753d6714dc09be65 (diff)
separate json test out of test-code (#674)
* separate json testing * add to ci
-rw-r--r--.github/workflows/ci.yml5
-rw-r--r--package.json3
-rw-r--r--test/data/json.json1
-rw-r--r--test/data/vitest.json.config.json7
-rw-r--r--vitest.config.js3
5 files changed, 17 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4ea950b8..ea42aab4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -53,6 +53,11 @@ jobs:
env:
CI: true
+ - name: Test JSON
+ run: npm run test-json
+ env:
+ CI: true
+
- name: Build Legal
run: npm run license-report
diff --git a/package.json b/package.json
index 77a19eec..715977f8 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,7 @@
"bench": "vitest bench",
"build": "node ./dev/bin/build.js",
"build-libs": "node ./dev/bin/build-libs.js",
- "test": "npm run test-lint-js && npm run test-ts && npm run test-lint-css && npm run test-lint-html && npm run test-code && npm run test-build",
+ "test": "npm run test-lint-js && npm run test-ts && npm run test-lint-css && npm run test-lint-html && npm run test-code && npm run test-json && npm run test-build",
"test-lint-js": "npx eslint .",
"test-lint-json": "npx eslint **/*.json",
"test-lint-css": "npx stylelint \"ext/**/*.css\" \"test/**/*.css\" \"dev/**/*.css\"",
@@ -25,6 +25,7 @@
"test-code": "vitest run",
"test-code-write": "vitest run --config test/data/vitest.write.config.json",
"test-options-update": "vitest run --config test/data/vitest.options.config.json",
+ "test-json": "vitest run --config test/data/vitest.json.config.json",
"test-build": "node ./dev/bin/build.js --dryRun --all",
"license-report": "license-report --output=html --only=prod --fields=name --fields=installedVersion --fields=licenseType --fields=link --html.cssFile=dev/data/legal-npm.css > ext/legal-npm.html",
"license-report-markdown": "license-report --output=markdown --only=prod --fields=name --fields=installedVersion --fields=licenseType --fields=link",
diff --git a/test/data/json.json b/test/data/json.json
index a99f53a3..c7c1d3aa 100644
--- a/test/data/json.json
+++ b/test/data/json.json
@@ -24,6 +24,7 @@
{"path": "test/jsconfig.json", "ignore": true},
{"path": "test/data/vitest.write.config.json", "ignore": true},
{"path": "test/data/vitest.options.config.json", "ignore": true},
+ {"path": "test/data/vitest.json.config.json", "ignore": true},
{"path": "benches/jsconfig.json", "ignore": true},
{
diff --git a/test/data/vitest.json.config.json b/test/data/vitest.json.config.json
new file mode 100644
index 00000000..4965ffa9
--- /dev/null
+++ b/test/data/vitest.json.config.json
@@ -0,0 +1,7 @@
+{
+ "test": {
+ "include": [
+ "../**/json.test.js"
+ ]
+ }
+}
diff --git a/vitest.config.js b/vitest.config.js
index 7603e92c..0bb56a97 100644
--- a/vitest.config.js
+++ b/vitest.config.js
@@ -24,7 +24,8 @@ export default defineConfig({
exclude: [
...configDefaults.exclude,
'dev/lib/**',
- 'test/playwright/**'
+ 'test/playwright/**',
+ 'test/json.test.js'
],
poolOptions: {
threads: {