From fe0183d2ee44399b49746a695242a601beb5c9d6 Mon Sep 17 00:00:00 2001 From: maxjeffos <44034094+maxjeffos@users.noreply.github.com> Date: Fri, 19 Feb 2021 16:52:13 -0500 Subject: [PATCH] test: enable jest testing in snyk-protect workspace --- packages/snyk-protect/jest.config.js | 12 ++++++++++++ packages/snyk-protect/package.json | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 packages/snyk-protect/jest.config.js diff --git a/packages/snyk-protect/jest.config.js b/packages/snyk-protect/jest.config.js new file mode 100644 index 0000000000..d5af8b50dc --- /dev/null +++ b/packages/snyk-protect/jest.config.js @@ -0,0 +1,12 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + transform: {}, // ignore .babelrc file + collectCoverage: false, // not collecting coverage for now + collectCoverageFrom: ['src/**/*.ts'], + coverageReporters: ['text-summary', 'html'], + testMatch: [ + '/test/**/*.spec.ts', + '\\test\\**\\*.spec.ts', // for Windows + ] +}; diff --git a/packages/snyk-protect/package.json b/packages/snyk-protect/package.json index 3155350788..5da1de4b5e 100644 --- a/packages/snyk-protect/package.json +++ b/packages/snyk-protect/package.json @@ -22,7 +22,11 @@ "node": ">=8" }, "scripts": { - "build": "tsc" + "build": "tsc", + "test": "npm run test:unit && npm run test:acceptance", + "test:unit": "jest test/unit/*.spec.ts", + "test:acceptance": "jest test/acceptance/*.spec.ts", + "format": "prettier --write '{src,test,scripts}/**/*.{js,ts}'" }, "keywords": [ "security",