From 24f146e1ae1299c963aa09d2a68e36ff2244fc5d Mon Sep 17 00:00:00 2001 From: Kadphol Date: Fri, 3 Jan 2025 01:00:52 +0700 Subject: [PATCH] chore: fix jest and test package --- jest.config.ts | 2 ++ package.json | 4 ++-- pnpm-lock.yaml | 54 +++++++++++++++++++++++++------------------------- 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/jest.config.ts b/jest.config.ts index fdae720..e73258f 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -18,10 +18,12 @@ const config: Config = { collectCoverageFrom: ['/src/**/*.(ts|tsx)'], coverageProvider: 'v8', coveragePathIgnorePatterns: ['/node_modules/'], + testMatch: ['/__tests__/**/*.(spec|test).(ts|tsx)'], moduleNameMapper: { '^@/(.*)$': '/src/$1', '@mock/(.*)$': '/__mock__/$1', '@tests/(.*)$': '/__tests__/$1', + '@test/utils': '/__tests__/test-utils.tsx', }, moduleDirectories: ['node_modules', '/'], testEnvironment: 'jsdom', diff --git a/package.json b/package.json index 28624e7..1df9974 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "lint-staged": "^15.2.10", - "msw": "^2.4.9", + "msw": "2.4.3", "postcss": "^8", "prettier": "^3.4.2", "prettier-plugin-organize-imports": "^4.1.0", @@ -64,7 +64,7 @@ "ts-jest": "^29.2.5", "ts-node": "^10.9.2", "typescript": "^5", - "undici": "^7" + "undici": "^6" }, "packageManager": "pnpm@9.15.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a02237..a4b7701 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -112,8 +112,8 @@ importers: specifier: ^15.2.10 version: 15.2.10 msw: - specifier: ^2.4.9 - version: 2.4.10(typescript@5.6.3) + specifier: 2.4.3 + version: 2.4.3(typescript@5.6.3) postcss: specifier: ^8 version: 8.4.47 @@ -145,8 +145,8 @@ importers: specifier: ^5 version: 5.6.3 undici: - specifier: ^7 - version: 7.1.0 + specifier: ^6 + version: 6.21.0 packages: @@ -334,8 +334,8 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@bundled-es-modules/cookie@2.0.0': - resolution: {integrity: sha512-Or6YHg/kamKHpxULAdSqhGqnWFneIXu1NKvvfBBzKGwpVsYuFIQ5aBPHDnnoR3ghW1nvSkALd+EF9iMtY7Vjxw==} + '@bundled-es-modules/cookie@2.0.1': + resolution: {integrity: sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw==} '@bundled-es-modules/statuses@1.0.1': resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} @@ -590,8 +590,8 @@ packages: resolution: {integrity: sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg==} engines: {node: '>=18'} - '@inquirer/figures@1.0.7': - resolution: {integrity: sha512-m+Trk77mp54Zma6xLkLuY+mvanPxlE4A7yNKs2HBiyZ4UkVs28Mv5c/pgWrHeInx+USHeX/WEPzjrWrcJiQgjw==} + '@inquirer/figures@1.0.9': + resolution: {integrity: sha512-BXvGj0ehzrngHTPTDqUoDT3NXL8U0RxUk2zJm2A66RhCEIWdtU1v6GuUqNAgArW4PQ9CinqIWyHdQgdwOj06zQ==} engines: {node: '>=18'} '@inquirer/type@1.5.5': @@ -701,8 +701,8 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - '@mswjs/interceptors@0.35.9': - resolution: {integrity: sha512-SSnyl/4ni/2ViHKkiZb8eajA/eN1DNFaHjhGiLUdZvDz6PKF4COSf/17xqSz64nOo2Ia29SA6B2KNCsyCbVmaQ==} + '@mswjs/interceptors@0.29.1': + resolution: {integrity: sha512-3rDakgJZ77+RiQUuSK69t1F0m8BQKA8Vh5DCS5V0DWvNY67zob2JhhQrhCO0AKLGINTRSFd1tBaHcJTkhefoSw==} engines: {node: '>=18'} '@next/env@15.1.0': @@ -1562,8 +1562,8 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - cookie@0.5.0: - resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + cookie@0.7.2: + resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} engines: {node: '>= 0.6'} core-util-is@1.0.3: @@ -3070,8 +3070,8 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - msw@2.4.10: - resolution: {integrity: sha512-bDQh9b25JK4IKMs5hnamwAkcNZ9RwA4mR/4YcgWkzwHOxj7UICbVJfmChJvY1UCAAMraPpvjHdxjoUDpc3F+Qw==} + msw@2.4.3: + resolution: {integrity: sha512-PXK3wOQHwDtz6JYVyAVlQtzrLr6bOAJxggw5UHm3CId79+W7238aNBD1zJVkFY53o/DMacuIfgesW2nv9yCO3Q==} engines: {node: '>=18'} hasBin: true peerDependencies: @@ -4244,9 +4244,9 @@ packages: undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - undici@7.1.0: - resolution: {integrity: sha512-3+mdX2R31khuLCm2mKExSlMdJsfol7bJkIMH80tdXA74W34rT1jKemUTlYR7WY3TqsV4wfOgpatWmmB2Jl1+5g==} - engines: {node: '>=20.18.1'} + undici@6.21.0: + resolution: {integrity: sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw==} + engines: {node: '>=18.17'} unicode-emoji-modifier-base@1.0.0: resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} @@ -4664,9 +4664,9 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@bundled-es-modules/cookie@2.0.0': + '@bundled-es-modules/cookie@2.0.1': dependencies: - cookie: 0.5.0 + cookie: 0.7.2 '@bundled-es-modules/statuses@1.0.1': dependencies: @@ -4935,7 +4935,7 @@ snapshots: '@inquirer/core@9.2.1': dependencies: - '@inquirer/figures': 1.0.7 + '@inquirer/figures': 1.0.9 '@inquirer/type': 2.0.0 '@types/mute-stream': 0.0.4 '@types/node': 22.7.5 @@ -4948,7 +4948,7 @@ snapshots: wrap-ansi: 6.2.0 yoctocolors-cjs: 2.1.2 - '@inquirer/figures@1.0.7': {} + '@inquirer/figures@1.0.9': {} '@inquirer/type@1.5.5': dependencies: @@ -5161,7 +5161,7 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@mswjs/interceptors@0.35.9': + '@mswjs/interceptors@0.29.1': dependencies: '@open-draft/deferred-promise': 2.2.0 '@open-draft/logger': 0.3.0 @@ -6155,7 +6155,7 @@ snapshots: convert-source-map@2.0.0: {} - cookie@0.5.0: {} + cookie@0.7.2: {} core-util-is@1.0.3: {} @@ -7994,13 +7994,13 @@ snapshots: ms@2.1.3: {} - msw@2.4.10(typescript@5.6.3): + msw@2.4.3(typescript@5.6.3): dependencies: - '@bundled-es-modules/cookie': 2.0.0 + '@bundled-es-modules/cookie': 2.0.1 '@bundled-es-modules/statuses': 1.0.1 '@bundled-es-modules/tough-cookie': 0.1.6 '@inquirer/confirm': 3.2.0 - '@mswjs/interceptors': 0.35.9 + '@mswjs/interceptors': 0.29.1 '@open-draft/until': 2.1.0 '@types/cookie': 0.6.0 '@types/statuses': 2.0.5 @@ -9105,7 +9105,7 @@ snapshots: undici-types@6.19.8: {} - undici@7.1.0: {} + undici@6.21.0: {} unicode-emoji-modifier-base@1.0.0: {}