From 9abbaf32abd3cb2e27fe9827667ea20696a37cec Mon Sep 17 00:00:00 2001 From: "Jarlem Red J. de Peralta" Date: Thu, 15 Dec 2022 22:41:31 +0800 Subject: [PATCH] test: configure framework to test typescript files --- .mocharc.json | 8 ++++++++ pnpm-lock.yaml | 20 ++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 .mocharc.json diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 0000000..e743043 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,8 @@ +{ + "extensions": ["ts"], + "spec": ["**/*.test.*"], + "node-option": [ + "experimental-specifier-resolution=node", + "loader=ts-node/esm" + ] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 626faaf..f1f93c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,6 +3,7 @@ lockfileVersion: 5.4 specifiers: '@types/chai': ^4.3.4 '@types/mocha': ^10.0.1 + '@types/node': ^18.11.15 '@types/sinon': ^10.0.13 '@typescript-eslint/eslint-plugin': ^5.46.1 '@typescript-eslint/parser': ^5.46.1 @@ -30,6 +31,7 @@ dependencies: devDependencies: '@types/chai': 4.3.4 '@types/mocha': 10.0.1 + '@types/node': 18.11.15 '@types/sinon': 10.0.13 '@typescript-eslint/eslint-plugin': 5.46.1_imrg37k3svwu377c6q7gkarwmi '@typescript-eslint/parser': 5.46.1_ha6vam6werchizxrnqvarmz2zu @@ -44,9 +46,9 @@ devDependencies: sass: 1.56.2 sinon: 15.0.0 tailwindcss: 3.2.4_ra2vnoek4vhbzktaezawwqbin4 - ts-node: 10.9.1_typescript@4.9.4 + ts-node: 10.9.1_ewfw2lwfc3dwdvz7r6yz2ssqyi typescript: 4.9.4 - vite: 4.0.1_sass@1.56.2 + vite: 4.0.1_o2iixvyklpce477lkpnahelma4 vue-eslint-parser: 9.1.0_eslint@8.29.0 vue-tsc: 1.0.13_typescript@4.9.4 @@ -418,6 +420,10 @@ packages: resolution: {integrity: sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==} dev: true + /@types/node/18.11.15: + resolution: {integrity: sha512-VkhBbVo2+2oozlkdHXLrb3zjsRkpdnaU2bXmX8Wgle3PUi569eLRaHGlgETQHR7lLL1w7GiG3h9SnePhxNDecw==} + dev: true + /@types/semver/7.3.13: resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} dev: true @@ -568,7 +574,7 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.0.1_sass@1.56.2 + vite: 4.0.1_o2iixvyklpce477lkpnahelma4 vue: 3.2.45 dev: true @@ -1851,7 +1857,7 @@ packages: dependencies: lilconfig: 2.0.6 postcss: 8.4.20 - ts-node: 10.9.1_typescript@4.9.4 + ts-node: 10.9.1_ewfw2lwfc3dwdvz7r6yz2ssqyi yaml: 1.10.2 dev: true @@ -2130,7 +2136,7 @@ packages: is-number: 7.0.0 dev: true - /ts-node/10.9.1_typescript@4.9.4: + /ts-node/10.9.1_ewfw2lwfc3dwdvz7r6yz2ssqyi: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -2149,6 +2155,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 + '@types/node': 18.11.15 acorn: 8.8.1 acorn-walk: 8.2.0 arg: 4.1.3 @@ -2222,7 +2229,7 @@ packages: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /vite/4.0.1_sass@1.56.2: + /vite/4.0.1_o2iixvyklpce477lkpnahelma4: resolution: {integrity: sha512-kZQPzbDau35iWOhy3CpkrRC7It+HIHtulAzBhMqzGHKRf/4+vmh8rPDDdv98SWQrFWo6//3ozwsRmwQIPZsK9g==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -2247,6 +2254,7 @@ packages: terser: optional: true dependencies: + '@types/node': 18.11.15 esbuild: 0.16.4 postcss: 8.4.20 resolve: 1.22.1