diff --git a/jest.config.ts b/jest.config.ts index 1e6e7903..2a02199e 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -68,4 +68,5 @@ module.exports = { collectCoverage: true, coverageDirectory: 'coverage', coverageReporters: ['json', 'lcov', 'text', 'clover'], + testPathIgnorePatterns: ['/node_modules/', '/allure-results/'], // Add this line to ignore the allure-results directory }; diff --git a/jest.local.config.ts b/jest.local.config.ts new file mode 100644 index 00000000..680a65d8 --- /dev/null +++ b/jest.local.config.ts @@ -0,0 +1,13 @@ +const os = require("os"); + +module.exports = { + preset: 'ts-jest', + testEnvironment: "node", // Change to standard node environment + reporters: [ + "default", // default jest reporter + ['jest-html-reporter', { outputPath: 'local_test/jest.html' }], // jest html reporter + ], + collectCoverage: true, + coverageDirectory: 'local_test/coverage', + coverageReporters: ['json', 'lcov', 'text', 'clover'], +}; \ No newline at end of file diff --git a/package.json b/package.json index 2145b691..9655c2d7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "scripts": { "test": "./run-tests.sh", - "test:github": "./run-tests-github.sh" + "test:github": "./run-tests-github.sh", + "test:local": "jest --config jest.local.config.ts" }, "devDependencies": { "@types/jest": "^29.5.14", diff --git a/run-tests-github.sh b/run-tests-github.sh index dda81245..88053075 100755 --- a/run-tests-github.sh +++ b/run-tests-github.sh @@ -23,7 +23,7 @@ echo "[INFO] Timezone after change: $(date +%Z)" # Run Jest tests echo "[INFO] Running Jest tests" -npx jest +jest # Generate Allure report echo "[INFO] Generating Allure report" diff --git a/run-tests.sh b/run-tests.sh index bf488612..6cd49f59 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -23,7 +23,7 @@ echo "[INFO] Timezone after change: $(date +%Z)" # Run Jest tests echo "[INFO] Running Jest tests" -npx jest +jest # Generate Allure report echo "[INFO] Generating Allure report"