Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* © Copyright IBM Corporation 2024. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const isNode22 = process.versions.node.startsWith('22.');

/** @type {import('jest').Config} */
const config = {
collectCoverage: true,
coverageDirectory: './coverage/',
coveragePathIgnorePatterns: ['<rootDir>/test/'],
preset: 'ts-jest',
testEnvironment: 'node',
testResultsProcessor: 'jest-junit',
};

if (isNode22) {
config.testPathIgnorePatterns = [
'/node_modules/',
'test/unit/errorResponseInterceptor.test.js',
];
}

module.exports = config;
76 changes: 23 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 6 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@
"postbuild": "npm run copymeta",
"version": "bump-my-version bump patch --allow-dirty --new-version $npm_package_version && git add README.md .bumpversion.toml docs/*.md",
"postversion": "npm run copymeta",
"jest": "jest --runInBand",
"test": "npm run build && npm run lint && jest --runInBand test/",
"test-unit": "npm run build && jest --runInBand test/unit/",
"test-integration": "npm run build && jest --runInBand test/integration",
"test-ci": "jest --runInBand --testNamePattern='^((?!@slow).)*$' test/",
"test-unit-ci": "jest --runInBand test/unit/",
"test-integration-ci": "jest --runInBand --no-colors --testNamePattern='^((?!@slow).)*$' --json test/integration > test-output.log",
"jest": "NODE_OPTIONS=--experimental-vm-modules jest --runInBand",
"test": "npm run build && npm run lint && npm run jest --",
"test-unit": "npm test -- test/unit/",
"test-integration": "npm test -- test/integration",
"test-ci": "npm test -- --testNamePattern='^((?!@slow).)*$' test/",
"typedoc": "typedoc"
},
"license": "Apache-2.0",
Expand Down Expand Up @@ -61,7 +59,7 @@
"globals": "17.13.0",
"jest": "30.5.2",
"jest-junit": "17.0.0",
"nock": "14.0.17",
"nock": "15.0.1",
"prettier": "3.9.9",
"sinon": "22.1.0",
"ts-jest": "29.4.14",
Expand All @@ -72,16 +70,6 @@
"extend": "^3.0.2",
"tough-cookie": "^6.0.0"
},
"jest": {
"collectCoverage": true,
"coverageDirectory": "./coverage/",
"coveragePathIgnorePatterns": [
"<rootDir>/test/"
],
"preset": "ts-jest",
"testEnvironment": "node",
"testResultsProcessor": "jest-junit"
},
"jest-junit": {
"suiteName": "Generated unit tests",
"outputDirectory": "./junitreports/",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/errorResponseInterceptor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

const assert = require('assert');
const nock = require('nock');
const { default: nock } = require('nock');
const { getClient } = require('./features/testDataProviders.js');
const {
errorResponseInterceptor,
Expand Down
Loading