meeshkan / unmock-js

Fuzz test your REST API calls
https://unmock.io
93 stars 8 forks source link

Typescript fails to compile when including unmock as a package dependency #383

Closed mikesol closed 4 years ago

mikesol commented 4 years ago

Description

Unmock fails to compile because of a type import

Steps to Reproduce

Expected Result

Should compile.

Actual Result

Fails with this error:

node_modules/unmock-node/dist/backend.d.ts:2:37 - error TS2307: Cannot find module 'unmock-core/src/interceptor'.
2 import { IInterceptorFactory } from "unmock-core/src/interceptor";

Additional Context

To fix the bug, I'd recommend hoisting all imports to a top-level namespace. As the src directory is not packaged (only the dist one is), unmock-node cannot find unmock-core/src.