From f8701cae5c7def2906be6d233dd43b874ee6f75a Mon Sep 17 00:00:00 2001 From: Hiroki Miyaji Date: Thu, 11 Jan 2024 09:18:53 +0900 Subject: [PATCH 1/3] update vitest --- package.json | 2 +- pnpm-lock.yaml | 176 +++++++++++++++++++++++-------------------------- 2 files changed, 85 insertions(+), 93 deletions(-) diff --git a/package.json b/package.json index 46f1a2d..805b697 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "tsx": "^4.7.0", "turbo": "^1.11.3", "typescript": "5.3.3", - "vitest": "^0.34.6" + "vitest": "^1.1.3" }, "packageManager": "pnpm@8.14.0", "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d2c9c7..ec599be 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ importers: version: 2.27.1 '@types/node': specifier: ^18 - version: 18.19.5 + version: 18.19.6 '@typescript-eslint/eslint-plugin': specifier: 6.18.1 version: 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) @@ -40,7 +40,7 @@ importers: version: 3.0.0(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.56.0) eslint-plugin-vitest: specifier: ^0.3.20 - version: 0.3.20(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.56.0)(typescript@5.3.3)(vitest@0.34.6) + version: 0.3.20(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.1.3) husky: specifier: ^8.0.3 version: 8.0.3 @@ -63,8 +63,8 @@ importers: specifier: 5.3.3 version: 5.3.3 vitest: - specifier: ^0.34.6 - version: 0.34.6 + specifier: ^1.1.3 + version: 1.1.3(@types/node@18.19.6) packages/cli: dependencies: @@ -615,11 +615,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@humanwhocodes/config-array@0.11.13: - resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==} + /@humanwhocodes/config-array@0.11.14: + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} dependencies: - '@humanwhocodes/object-schema': 2.0.1 + '@humanwhocodes/object-schema': 2.0.2 debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: @@ -631,8 +631,8 @@ packages: engines: {node: '>=12.22'} dev: true - /@humanwhocodes/object-schema@2.0.1: - resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} + /@humanwhocodes/object-schema@2.0.2: + resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} dev: true /@isaacs/cliui@8.0.2: @@ -861,16 +861,6 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true - /@types/chai-subset@1.3.5: - resolution: {integrity: sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==} - dependencies: - '@types/chai': 4.3.11 - dev: true - - /@types/chai@4.3.11: - resolution: {integrity: sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==} - dev: true - /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} dev: true @@ -890,7 +880,7 @@ packages: /@types/node-fetch@2.6.10: resolution: {integrity: sha512-PPpPK6F9ALFTn59Ka3BaL+qGuipRfxNE8qVgkp0bVixeiR2c2/L+IVOiBdu9JhhT22sWnQEp6YyHGI2b2+CMcA==} dependencies: - '@types/node': 18.19.5 + '@types/node': 18.19.6 form-data: 4.0.0 dev: false @@ -898,8 +888,8 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node@18.19.5: - resolution: {integrity: sha512-22MG6T02Hos2JWfa1o5jsIByn+bc5iOt1IS4xyg6OG68Bu+wMonVZzdrgCw693++rpLE9RUT/Bx15BeDzO0j+g==} + /@types/node@18.19.6: + resolution: {integrity: sha512-X36s5CXMrrJOs2lQCdDF68apW4Rfx9ixYMawlepwmE4Anezv/AV2LSpKD1Ub8DAc+urp5bk0BGZ6NtmBitfnsg==} dependencies: undici-types: 5.26.5 @@ -1051,40 +1041,41 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitest/expect@0.34.6: - resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} + /@vitest/expect@1.1.3: + resolution: {integrity: sha512-MnJqsKc1Ko04lksF9XoRJza0bGGwTtqfbyrsYv5on4rcEkdo+QgUdITenBQBUltKzdxW7K3rWh+nXRULwsdaVg==} dependencies: - '@vitest/spy': 0.34.6 - '@vitest/utils': 0.34.6 + '@vitest/spy': 1.1.3 + '@vitest/utils': 1.1.3 chai: 4.4.0 dev: true - /@vitest/runner@0.34.6: - resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==} + /@vitest/runner@1.1.3: + resolution: {integrity: sha512-Va2XbWMnhSdDEh/OFxyUltgQuuDRxnarK1hW5QNN4URpQrqq6jtt8cfww/pQQ4i0LjoYxh/3bYWvDFlR9tU73g==} dependencies: - '@vitest/utils': 0.34.6 - p-limit: 4.0.0 - pathe: 1.1.1 + '@vitest/utils': 1.1.3 + p-limit: 5.0.0 + pathe: 1.1.2 dev: true - /@vitest/snapshot@0.34.6: - resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==} + /@vitest/snapshot@1.1.3: + resolution: {integrity: sha512-U0r8pRXsLAdxSVAyGNcqOU2H3Z4Y2dAAGGelL50O0QRMdi1WWeYHdrH/QWpN1e8juWfVKsb8B+pyJwTC+4Gy9w==} dependencies: magic-string: 0.30.5 - pathe: 1.1.1 + pathe: 1.1.2 pretty-format: 29.7.0 dev: true - /@vitest/spy@0.34.6: - resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==} + /@vitest/spy@1.1.3: + resolution: {integrity: sha512-Ec0qWyGS5LhATFQtldvChPTAHv08yHIOZfiNcjwRQbFPHpkih0md9KAbs7TfeIfL7OFKoe7B/6ukBTqByubXkQ==} dependencies: tinyspy: 2.2.0 dev: true - /@vitest/utils@0.34.6: - resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==} + /@vitest/utils@1.1.3: + resolution: {integrity: sha512-Dyt3UMcdElTll2H75vhxfpZu03uFpXRCHxWnzcrFjZxT1kTbq8ALUYIeBgGolo1gldVdI0YSlQRacsqxTwNqwg==} dependencies: diff-sequences: 29.6.3 + estree-walker: 3.0.3 loupe: 2.3.7 pretty-format: 29.7.0 dev: true @@ -1788,7 +1779,7 @@ packages: object.assign: 4.1.5 regexp.prototype.flags: 1.5.1 safe-array-concat: 1.0.1 - safe-regex-test: 1.0.0 + safe-regex-test: 1.0.1 string.prototype.trim: 1.2.8 string.prototype.trimend: 1.0.7 string.prototype.trimstart: 1.0.7 @@ -1992,7 +1983,7 @@ packages: eslint-rule-composer: 0.3.0 dev: true - /eslint-plugin-vitest@0.3.20(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.56.0)(typescript@5.3.3)(vitest@0.34.6): + /eslint-plugin-vitest@0.3.20(@typescript-eslint/eslint-plugin@6.18.1)(eslint@8.56.0)(typescript@5.3.3)(vitest@1.1.3): resolution: {integrity: sha512-O05k4j9TGMOkkghj9dRgpeLDyOSiVIxQWgNDPfhYPm5ioJsehcYV/zkRLekQs+c8+RBCVXucSED3fYOyy2EoWA==} engines: {node: ^18.0.0 || >= 20.0.0} peerDependencies: @@ -2008,7 +1999,7 @@ packages: '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 - vitest: 0.34.6 + vitest: 1.1.3(@types/node@18.19.6) transitivePeerDependencies: - supports-color - typescript @@ -2041,7 +2032,7 @@ packages: '@eslint-community/regexpp': 4.10.0 '@eslint/eslintrc': 2.1.4 '@eslint/js': 8.56.0 - '@humanwhocodes/config-array': 0.11.13 + '@humanwhocodes/config-array': 0.11.14 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 '@ungap/structured-clone': 1.2.0 @@ -2113,6 +2104,12 @@ packages: engines: {node: '>=4.0'} dev: true + /estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + dependencies: + '@types/estree': 1.0.5 + dev: true + /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -2937,9 +2934,12 @@ packages: strip-bom: 3.0.0 dev: true - /local-pkg@0.4.3: - resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} + /local-pkg@0.5.0: + resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} + dependencies: + mlly: 1.4.2 + pkg-types: 1.0.3 dev: true /locate-path@5.0.0: @@ -3163,7 +3163,7 @@ packages: resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} dependencies: acorn: 8.11.3 - pathe: 1.1.1 + pathe: 1.1.2 pkg-types: 1.0.3 ufo: 1.3.2 dev: true @@ -3318,7 +3318,7 @@ packages: resolution: {integrity: sha512-ezm/O3eiZMnyBqirUnWm9N6INJU1WhNtz+nK/Zj/2oyKvRz9pgpViDxa5wYOtyGYXPn1sIKBV0I/S4BDhtydqw==} hasBin: true dependencies: - '@types/node': 18.19.5 + '@types/node': 18.19.6 '@types/node-fetch': 2.6.10 abort-controller: 3.0.0 agentkeepalive: 4.5.0 @@ -3373,9 +3373,9 @@ packages: yocto-queue: 0.1.0 dev: true - /p-limit@4.0.0: - resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /p-limit@5.0.0: + resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} + engines: {node: '>=18'} dependencies: yocto-queue: 1.0.0 dev: true @@ -3458,8 +3458,8 @@ packages: engines: {node: '>=8'} dev: true - /pathe@1.1.1: - resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} + /pathe@1.1.2: + resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} dev: true /pathval@1.1.1: @@ -3503,7 +3503,7 @@ packages: dependencies: jsonc-parser: 3.2.0 mlly: 1.4.2 - pathe: 1.1.1 + pathe: 1.1.2 dev: true /postcss-load-config@4.0.2: @@ -3754,8 +3754,9 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: false - /safe-regex-test@1.0.0: - resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + /safe-regex-test@1.0.1: + resolution: {integrity: sha512-Y5NejJTTliTyY4H7sipGqY+RX5P87i3F7c4Rcepy72nq+mNLhIsD0W4c7kEmduMDQCSqtPsXPlSTsFhh2LQv+g==} + engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.5 get-intrinsic: 1.2.2 @@ -4146,8 +4147,8 @@ packages: resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==} dev: true - /tinypool@0.7.0: - resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} + /tinypool@0.8.1: + resolution: {integrity: sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==} engines: {node: '>=14.0.0'} dev: true @@ -4486,17 +4487,16 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite-node@0.34.6(@types/node@18.19.5): - resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} - engines: {node: '>=v14.18.0'} + /vite-node@1.1.3(@types/node@18.19.6): + resolution: {integrity: sha512-BLSO72YAkIUuNrOx+8uznYICJfTEbvBAmWClY3hpath5+h1mbPS5OMn42lrTxXuyCazVyZoDkSRnju78GiVCqA==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: cac: 6.7.14 debug: 4.3.4 - mlly: 1.4.2 - pathe: 1.1.1 + pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.0.11(@types/node@18.19.5) + vite: 5.0.11(@types/node@18.19.6) transitivePeerDependencies: - '@types/node' - less @@ -4508,7 +4508,7 @@ packages: - terser dev: true - /vite@5.0.11(@types/node@18.19.5): + /vite@5.0.11(@types/node@18.19.6): resolution: {integrity: sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -4536,7 +4536,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.19.5 + '@types/node': 18.19.6 esbuild: 0.19.11 postcss: 8.4.33 rollup: 4.9.4 @@ -4544,22 +4544,22 @@ packages: fsevents: 2.3.3 dev: true - /vitest@0.34.6: - resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} - engines: {node: '>=v14.18.0'} + /vitest@1.1.3(@types/node@18.19.6): + resolution: {integrity: sha512-2l8om1NOkiA90/Y207PsEvJLYygddsOyr81wLQ20Ra8IlLKbyQncWsGZjnbkyG2KwwuTXLQjEPOJuxGMG8qJBQ==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@vitest/browser': '*' - '@vitest/ui': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': ^1.0.0 + '@vitest/ui': ^1.0.0 happy-dom: '*' jsdom: '*' - playwright: '*' - safaridriver: '*' - webdriverio: '*' peerDependenciesMeta: '@edge-runtime/vm': optional: true + '@types/node': + optional: true '@vitest/browser': optional: true '@vitest/ui': @@ -4568,36 +4568,28 @@ packages: optional: true jsdom: optional: true - playwright: - optional: true - safaridriver: - optional: true - webdriverio: - optional: true dependencies: - '@types/chai': 4.3.11 - '@types/chai-subset': 1.3.5 - '@types/node': 18.19.5 - '@vitest/expect': 0.34.6 - '@vitest/runner': 0.34.6 - '@vitest/snapshot': 0.34.6 - '@vitest/spy': 0.34.6 - '@vitest/utils': 0.34.6 - acorn: 8.11.3 + '@types/node': 18.19.6 + '@vitest/expect': 1.1.3 + '@vitest/runner': 1.1.3 + '@vitest/snapshot': 1.1.3 + '@vitest/spy': 1.1.3 + '@vitest/utils': 1.1.3 acorn-walk: 8.3.1 cac: 6.7.14 chai: 4.4.0 debug: 4.3.4 - local-pkg: 0.4.3 + execa: 8.0.1 + local-pkg: 0.5.0 magic-string: 0.30.5 - pathe: 1.1.1 + pathe: 1.1.2 picocolors: 1.0.0 std-env: 3.7.0 strip-literal: 1.3.0 tinybench: 2.5.1 - tinypool: 0.7.0 - vite: 5.0.11(@types/node@18.19.5) - vite-node: 0.34.6(@types/node@18.19.5) + tinypool: 0.8.1 + vite: 5.0.11(@types/node@18.19.6) + vite-node: 1.1.3(@types/node@18.19.6) why-is-node-running: 2.2.2 transitivePeerDependencies: - less From 5ce03596aac8c4b25b9ab6efe68aa5abadb1c81b Mon Sep 17 00:00:00 2001 From: Hiroki Miyaji Date: Thu, 11 Jan 2024 09:19:12 +0900 Subject: [PATCH 2/3] change valid matcher --- packages/cli/src/notion/__tests__/index.test.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/notion/__tests__/index.test.ts b/packages/cli/src/notion/__tests__/index.test.ts index e718b80..59d02b8 100644 --- a/packages/cli/src/notion/__tests__/index.test.ts +++ b/packages/cli/src/notion/__tests__/index.test.ts @@ -64,7 +64,7 @@ describe("DandoriNotionCli", () => { }); it("call generateDandoriNotionPages with database id", () => { - expect(mockGenerateDandoriNotionPages.mock.lastCall[1]).toContain({ + expect(mockGenerateDandoriNotionPages.mock.lastCall[1]).toMatchObject({ databaseId, }); }); @@ -81,7 +81,7 @@ describe("DandoriNotionCli", () => { it("call generateDandoriNotionPages with databasePropertiesMap.name", () => { expect( mockGenerateDandoriNotionPages.mock.lastCall[1].databasePropertiesMap, - ).toContain({ + ).toMatchObject({ name, }); }); @@ -98,7 +98,7 @@ describe("DandoriNotionCli", () => { it("call generateDandoriNotionPages with databasePropertiesMap.deadline", () => { expect( mockGenerateDandoriNotionPages.mock.lastCall[1].databasePropertiesMap, - ).toContain({ + ).toMatchObject({ deadline, }); }); @@ -115,7 +115,7 @@ describe("DandoriNotionCli", () => { it("call generateDandoriNotionPages with databasePropertiesMap.status", () => { expect( mockGenerateDandoriNotionPages.mock.lastCall[1].databasePropertiesMap, - ).toContain({ + ).toMatchObject({ status, }); }); @@ -132,7 +132,7 @@ describe("DandoriNotionCli", () => { it("call generateDandoriNotionPages with databasePropertiesMap.status.todo", () => { expect( mockGenerateDandoriNotionPages.mock.lastCall[1].databasePropertiesMap, - ).toContain({ + ).toMatchObject({ "status.todo": statusTodo, }); }); @@ -149,7 +149,7 @@ describe("DandoriNotionCli", () => { it("call generateDandoriNotionPages with databasePropertiesMap.status.doing", () => { expect( mockGenerateDandoriNotionPages.mock.lastCall[1].databasePropertiesMap, - ).toContain({ + ).toMatchObject({ "status.doing": statusDoing, }); }); @@ -166,7 +166,7 @@ describe("DandoriNotionCli", () => { it("call generateDandoriNotionPages with databasePropertiesMap.status.done", () => { expect( mockGenerateDandoriNotionPages.mock.lastCall[1].databasePropertiesMap, - ).toContain({ + ).toMatchObject({ "status.done": statusDone, }); }); From dc70e96cc51ba10babbd5fb48020804ccfd933a8 Mon Sep 17 00:00:00 2001 From: Hiroki Miyaji Date: Thu, 11 Jan 2024 13:47:10 +0900 Subject: [PATCH 3/3] fix load modules of test --- packages/cli/src/core/__tests__/index.test.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/cli/src/core/__tests__/index.test.ts b/packages/cli/src/core/__tests__/index.test.ts index 85d5fc1..c40a57f 100644 --- a/packages/cli/src/core/__tests__/index.test.ts +++ b/packages/cli/src/core/__tests__/index.test.ts @@ -16,13 +16,6 @@ import generateDandoriTasks, { OptionalTaskPropsOption, } from "@dandori/core"; -const { actualLoadFile } = await vi.hoisted(async () => { - const actualModule = await import("@dandori/libs"); - return { - actualLoadFile: actualModule.loadFile, - }; -}); - const tasks: DandoriTask[] = [ { id: "1", @@ -39,13 +32,14 @@ vi.mock("@dandori/core", () => ({ const mockLogError = vi.fn(); -vi.mock("@dandori/libs", () => { +vi.mock("@dandori/libs", async (importOriginal) => { + const actualModule = await importOriginal(); return { + ...actualModule, getLogLevel: () => "info", getLogger: vi.fn(() => ({ error: mockLogError, })), - loadFile: actualLoadFile, }; });