test: map imported module from the distribution files

This commit is contained in:
Alfi Maulana 2023-12-11 19:28:03 +07:00
parent ad6a9d3164
commit 6929d676af
No known key found for this signature in database
GPG Key ID: 2242A64C2A8DF5A4
2 changed files with 3 additions and 6 deletions

View File

@ -10,10 +10,7 @@
}, },
"extensionsToTreatAsEsm": [".ts", ".mts"], "extensionsToTreatAsEsm": [".ts", ".mts"],
"moduleNameMapper": { "moduleNameMapper": {
"^(\\.{1,2}/.*)\\.mjs$": "$1.mts" "^(\\.{1,2}/.*)\\.mjs$": "<rootDir>/dist/$1.mjs"
}, },
"testMatch": ["**/*.test.ts"], "testMatch": ["**/*.test.ts"]
"transform": {
"^.+\\.m?ts$": ["ts-jest", { "useESM": true }]
}
} }

View File

@ -5,7 +5,7 @@
"scripts": { "scripts": {
"bundle": "tsc && ncc build dist/main.mjs -o main", "bundle": "tsc && ncc build dist/main.mjs -o main",
"check": "sort-package-json && prettier --write . !main !README.md && eslint src", "check": "sort-package-json && prettier --write . !main !README.md && eslint src",
"test": "jest" "test": "tsc && jest"
}, },
"dependencies": { "dependencies": {
"@actions/core": "^1.10.1", "@actions/core": "^1.10.1",