From 36aca3e02dce5e4b7a30fa5234b229674be1fa57 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Thu, 17 Aug 2023 17:11:37 -0400 Subject: [PATCH] Testing next version of tap --- .gitignore | 1 + .taprc | 10 ---------- .taprc.yaml | 9 +++++++++ package.json | 12 +++++++----- test/schema-special-usage.test.js | 2 +- 5 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 .taprc create mode 100644 .taprc.yaml diff --git a/.gitignore b/.gitignore index 37985cb1fb9..28db2a5f5c0 100644 --- a/.gitignore +++ b/.gitignore @@ -162,6 +162,7 @@ test/types/index.js # test tap report out.tap +.tap/ # test certification test/https/fastify.cert diff --git a/.taprc b/.taprc deleted file mode 100644 index 3c1b6a03f8b..00000000000 --- a/.taprc +++ /dev/null @@ -1,10 +0,0 @@ -ts: false -jsx: false -flow: false -# the coverage is performed by c8 -check-coverage: false -coverage: false -node-arg: --allow-natives-syntax - -files: - - 'test/**/*.test.js' diff --git a/.taprc.yaml b/.taprc.yaml new file mode 100644 index 00000000000..d2475437a5c --- /dev/null +++ b/.taprc.yaml @@ -0,0 +1,9 @@ +node-arg: + - '--allow-natives-syntax' + +exclude: + - 'test/**/*.ts' + - 'test/bundler/**/*.js' + +files: + - 'test/**/*.test.js' diff --git a/package.json b/package.json index a5935b461b8..13f3a1c3d29 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "benchmark:parser": "npx concurrently -k -s first \"node ./examples/benchmark/parser.js\" \"npx autocannon -c 100 -d 30 -p 10 -i ./examples/benchmark/body.json -H \"content-type:application/jsoff\" -m POST localhost:3000/\"", "build:validation": "node build/build-error-serializer.js && node build/build-validation.js", "coverage": "npm run unit -- --coverage-report=html", - "coverage:ci": "c8 --reporter=lcov tap --coverage-report=html --no-browser --no-check-coverage", - "coverage:ci-check-coverage": "c8 check-coverage --branches 100 --functions 100 --lines 100 --statements 100", + "coverage:ci": "npm run unit -- --coverage --coverage-report=html --no-browser --no-check-coverage", + "coverage:ci-check-coverage": "npm run unit -- --cov --check-coverage", "lint": "npm run lint:standard && npm run lint:typescript && npm run lint:markdown", "lint:fix": "standard --fix && npm run lint:typescript:fix", "lint:markdown": "markdownlint-cli2", @@ -26,7 +26,7 @@ "test:validator:integrity": "npm run build:validation && git diff --quiet --ignore-all-space --ignore-blank-lines --ignore-cr-at-eol lib/error-serializer.js && git diff --quiet --ignore-all-space --ignore-blank-lines --ignore-cr-at-eol lib/configValidator.js", "test:typescript": "tsc test/types/import.ts && tsd", "test:watch": "npm run unit -- -w --no-coverage-report -R terse", - "unit": "c8 tap", + "unit": "tap", "unit:junit": "tap-mocha-reporter xunit < out.tap > test/junit-testresults.xml", "unit:report": "tap --cov --coverage-report=html --coverage-report=cobertura | tee out.tap" }, @@ -145,7 +145,6 @@ "ajv-i18n": "^4.2.0", "ajv-merge-patch": "^5.0.1", "branch-comparer": "^1.1.0", - "c8": "^8.0.0", "cross-env": "^7.0.3", "eslint": "^8.39.0", "eslint-config-standard": "^17.0.0", @@ -170,7 +169,7 @@ "snazzy": "^9.0.0", "split2": "^4.2.0", "standard": "^17.0.0", - "tap": "^16.3.4", + "tap": "^18.0.0-18", "tsd": "^0.28.1", "typescript": "^5.0.4", "undici": "^5.22.0", @@ -207,5 +206,8 @@ }, "tsd": { "directory": "test/types" + }, + "tap": { + "extends": ".taprc.yaml" } } diff --git a/test/schema-special-usage.test.js b/test/schema-special-usage.test.js index e71dc053d6c..180141a60be 100644 --- a/test/schema-special-usage.test.js +++ b/test/schema-special-usage.test.js @@ -704,7 +704,7 @@ test('Custom schema object should not trigger FST_ERR_SCH_DUPLICATE', async t => }) test('The default schema compilers should not be called when overwritte by the user', async t => { - const Fastify = t.mock('../', { + const Fastify = t.mockRequire('../', { '@fastify/ajv-compiler': () => { t.fail('The default validator compiler should not be called') },