From 6929d676af24475e7c3d103b09c4bc30f257eb0e Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 11 Dec 2023 19:28:03 +0700 Subject: [PATCH] test: map imported module from the distribution files --- jest.config.json | 7 ++----- package.json | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/jest.config.json b/jest.config.json index 46831bb..14a31f3 100644 --- a/jest.config.json +++ b/jest.config.json @@ -10,10 +10,7 @@ }, "extensionsToTreatAsEsm": [".ts", ".mts"], "moduleNameMapper": { - "^(\\.{1,2}/.*)\\.mjs$": "$1.mts" + "^(\\.{1,2}/.*)\\.mjs$": "/dist/$1.mjs" }, - "testMatch": ["**/*.test.ts"], - "transform": { - "^.+\\.m?ts$": ["ts-jest", { "useESM": true }] - } + "testMatch": ["**/*.test.ts"] } diff --git a/package.json b/package.json index f24f560..3cfb27a 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "bundle": "tsc && ncc build dist/main.mjs -o main", "check": "sort-package-json && prettier --write . !main !README.md && eslint src", - "test": "jest" + "test": "tsc && jest" }, "dependencies": { "@actions/core": "^1.10.1",