From ecdbba47df8ee102b6dbdcd661ba5db92556f116 Mon Sep 17 00:00:00 2001 From: AlixH Date: Fri, 12 Nov 2021 14:46:33 +0100 Subject: [PATCH] Added jest-junit --- jest.config.js | 2 ++ package-lock.json | 75 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 3 files changed, 79 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 2822c7d6a..6c324d181 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,7 @@ module.exports = { preset: 'react-native', + reporters: [ "default", "jest-junit" ], + testResultsProcessor: "jest-junit", globals: { 'ts-jest': { // Tell ts-jest about our typescript config. diff --git a/package-lock.json b/package-lock.json index e32335a01..4e581acef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -128,6 +128,7 @@ "import-sort-parser-typescript": "^6.0.0", "import-sort-style-module": "^6.0.0", "jest": "^26.6.3", + "jest-junit": "^13.0.0", "jetifier": "^2.0.0", "metro": "^0.64.0", "metro-config": "^0.64.0", @@ -17195,6 +17196,42 @@ "node": ">=8" } }, + "node_modules/jest-junit": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-13.0.0.tgz", + "integrity": "sha512-JSHR+Dhb32FGJaiKkqsB7AR3OqWKtldLd6ZH2+FJ8D4tsweb8Id8zEVReU4+OlrRO1ZluqJLQEETm+Q6/KilBg==", + "dev": true, + "dependencies": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/jest-junit/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-junit/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/jest-leak-detector": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", @@ -30265,6 +30302,12 @@ "xtend": "^4.0.0" } }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", + "dev": true + }, "node_modules/xml-js": { "version": "1.6.11", "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", @@ -43722,6 +43765,32 @@ } } }, + "jest-junit": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-13.0.0.tgz", + "integrity": "sha512-JSHR+Dhb32FGJaiKkqsB7AR3OqWKtldLd6ZH2+FJ8D4tsweb8Id8zEVReU4+OlrRO1ZluqJLQEETm+Q6/KilBg==", + "dev": true, + "requires": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + } + } + }, "jest-leak-detector": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", @@ -54018,6 +54087,12 @@ "xtend": "^4.0.0" } }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", + "dev": true + }, "xml-js": { "version": "1.6.11", "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", diff --git a/package.json b/package.json index ddb2676b9..cf6e6ba84 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "ios:release": "react-native run-ios --configuration Release", "pod:install": "cd ios && pod install", "pod:deintegrate": "cd ios && pod deintegrate", - "test": "jest", + "test": "jest -- -u --ci --testResultsProcessor='jest-junit' --reporters=default --reporters=jest-junit", "precommit": "npm test", "lint": "cross-env TIMING=1 eslint src __tests__ types App.tsx --ext .js,.ts,.tsx", "lint:fix": "cross-env TIMING=1 eslint src __tests__ types App.tsx --fix --ext .js,.ts,.tsx", @@ -191,6 +191,7 @@ "import-sort-parser-typescript": "^6.0.0", "import-sort-style-module": "^6.0.0", "jest": "^26.6.3", + "jest-junit": "^13.0.0", "jetifier": "^2.0.0", "metro": "^0.64.0", "metro-config": "^0.64.0",