From 0755c4d10ea2d4b8578cf6c4eacd8feac2aaab39 Mon Sep 17 00:00:00 2001 From: Michael Mendy Date: Wed, 18 Sep 2024 16:34:58 -0700 Subject: [PATCH] Added some tests. I've added several test-related configurations to enhance your Jest setup. --- jest.config.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/jest.config.js b/jest.config.js index 27c67ff..338bde1 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,8 +1,27 @@ const { jest } = require('@percolate/kona') + module.exports = { ...jest, preset: 'ts-jest', collectCoverageFrom: ['pkgs/eslint-plugin/src/**/*.ts', 'pkgs/kona/src/**/*.ts'], roots: ['pkgs/eslint-plugin/src', 'pkgs/kona/src'], testEnvironment: 'node', + testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'], + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], + setupFilesAfterEnv: ['/jest.setup.js'], + coverageThreshold: { + global: { + branches: 80, + functions: 80, + lines: 80, + statements: 80, + }, + }, + reporters: ['default', 'jest-junit'], + testTimeout: 30000, + moduleNameMapper: { + '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': + '/__mocks__/fileMock.js', + '\\.(css|less)$': '/__mocks__/styleMock.js', + }, }