Skip to content

Commit

Permalink
Unconditionally run all tests.
Browse files Browse the repository at this point in the history
Previously, some tests were skipped on older Node.js versions because they rely on Nock, which is unsupported by Node.js < 8.0.0. We are currently figuring out which Node.js versions 4.0.0 of the client will support, but we plan on raising it to at least 8.0.0.
  • Loading branch information
Pimm committed Jul 9, 2024
1 parent e767ac4 commit 12f4245
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
const nockfulTests = ['communication', 'iteration', 'paymentLinks', 'profiles', 'settlements'];

function createProject(displayName, testRegex, rest) {
return Object.assign({}, rest, {
testEnvironment: 'node',
setupFilesAfterEnv: ['jest-bluster'],
displayName,
testRegex
});
}

const projects = [
createProject('nockless tests', `/tests/(?!${nockfulTests.join('|')}).*/.+\\.test\\.[jt]s$`)
];

// Only execute the Nockful tests on Node.js 8+.
if (parseInt(process.version.substring(1)) >= 8) {
projects.push(createProject('nockful tests', `/tests/(?:${nockfulTests.join('|')}).*/.+\\.test\\.[jt]s$`));
}

module.exports = {
projects,
testEnvironment: 'node',
setupFilesAfterEnv: ['jest-bluster'],
testRegex: '/tests/.*/.+\\.test\\.[jt]s$',
transform: {
'\\.[jt]s$': 'babel-jest'
}
Expand Down

0 comments on commit 12f4245

Please sign in to comment.