-
-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Version: 2.3.0
Steps to reproduce:
-
execution passed, but type-checking failed
mkdir mocker-api-repro-execution-passed-but-type-checking-failed cd mocker-api-repro-execution-passed-but-type-checking-failed npm init -y npm install typescript mocker-api echo '{"compilerOptions":{"allowJs":true,"checkJs":true,"allowSyntheticDefaultImports":true}}' > tsconfig.json echo 'const mockerApi = require("mocker-api"); mockerApi(null, null); console.log("execution passed")' > index.js npx tsc --noEmit node index.js
index.js:1:42 - error TS2349: This expression is not callable. Type 'typeof import("~/mocker-api-repro-execution-passed-but-type-checking-failed/node_modules/mocker-api/lib/index")' has no call signatures. 1 const mockerApi = require("mocker-api"); mockerApi(null, null); console.log("execution passed") ~~~~~~~~~ Found 1 error. execution passed
-
type-checking passed, but execution failed
mkdir mocker-api-repro-type-checking-passed-but-execution-failed cd mocker-api-repro-type-checking-passed-but-execution-failed npm init -y npm install typescript mocker-api echo '{"compilerOptions":{"allowJs":true,"checkJs":true,"allowSyntheticDefaultImports":true}}' > tsconfig.json echo 'const mockerApi = require("mocker-api").default; mockerApi(null, null); console.log("execution passed")' > index.js npx tsc --noEmit node index.js
~/mocker-api-repro-type-checking-passed-but-execution-failed/index.js:1 const mockerApi = require("mocker-api").default; mockerApi(null, null); console.log("execution passed") ^ TypeError: mockerApi is not a function at Object.<anonymous> (~/mocker-api-repro-type-checking-passed-but-execution-failed/index.js:1:50)
Metadata
Metadata
Assignees
Labels
No labels