diff --git a/.gitignore b/.gitignore index 37985cb1fb..28db2a5f5c 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 3c1b6a03f8..0000000000 --- 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 0000000000..d2475437a5 --- /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 8d015a6152..2b1bd843f9 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", "citgm": "tap --jobs=1 --timeout=120" @@ -155,7 +155,6 @@ "ajv-i18n": "^4.2.0", "ajv-merge-patch": "^5.0.1", "branch-comparer": "^1.1.0", - "c8": "^8.0.1", "cross-env": "^7.0.3", "eslint": "^8.51.0", "eslint-config-standard": "^17.1.0", @@ -180,7 +179,7 @@ "snazzy": "^9.0.0", "split2": "^4.2.0", "standard": "^17.1.0", - "tap": "^16.3.9", + "tap": "^18.5.2", "tsd": "^0.29.0", "typescript": "^5.2.2", "undici": "^5.26.0", @@ -217,5 +216,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 e71dc053d6..180141a60b 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') },