From 1ba15609b802ddbe787bcf57869290af2d10bda5 Mon Sep 17 00:00:00 2001 From: Vasilios Pantazopoulos Date: Thu, 5 Dec 2024 12:54:29 -0500 Subject: [PATCH] ci: create CircleCI config and set it up for jest tests --- .circleci/config.yml | 11 +++++++++++ jest.config.cjs | 3 ++- package-lock.json | 43 +++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..2b0f85c --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,11 @@ +version: 2.1 + +orbs: + node: circleci/node@6.3 + +workflows: + commit: + jobs: + - node/test: + version: '20.18.1' + test-results-for: jest \ No newline at end of file diff --git a/jest.config.cjs b/jest.config.cjs index f8208b6..d8bf102 100644 --- a/jest.config.cjs +++ b/jest.config.cjs @@ -2,5 +2,6 @@ module.exports = { testEnvironment: "jsdom", moduleNameMapper: { ".(css|less|scss)$": "identity-obj-proxy" - } + }, + reporters: ["default", "jest-junit"], }; diff --git a/package-lock.json b/package-lock.json index 98aad12..5d39c8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,7 @@ "identity-obj-proxy": "^3.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", + "jest-junit": "^16.0.0", "rollup": "^4.21.0", "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-postcss": "^4.0.2", @@ -10209,6 +10210,42 @@ "fsevents": "^2.3.2" } }, + "node_modules/jest-junit": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-16.0.0.tgz", + "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", + "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/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "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": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", @@ -16164,6 +16201,12 @@ } } }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "node_modules/xml-name-validator": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", diff --git a/package.json b/package.json index 6fff229..ae797f1 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "identity-obj-proxy": "^3.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", + "jest-junit": "^16.0.0", "rollup": "^4.21.0", "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-postcss": "^4.0.2",