Skip to content

My Mocha tests fail when trying to use "Ref" in an ESM project #875

Answered by hasezoey
neilenns asked this question in Q&A
Discussion options

You must be logged in to vote

your reproduction repository does not actually contain any tests, so i cannot say any further than the first issue is that you have ts-node: transpileOnly: true set, which does no type-checking, which seems to be required for combined type and value imports

maybe somewhat related to TypeStrong/ts-loader#751

workaround without removing that option would be to split type and value imports, like

import { getModelForClass } from "...";
import type { Ref } from "...";

though this might become annoying to do and check manually (because things like vscode will always try to combine them)

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@neilenns
Comment options

@neilenns
Comment options

@hasezoey
Comment options

@neilenns
Comment options

Comment options

You must be logged in to vote
2 replies
@hasezoey
Comment options

Answer selected by hasezoey
@neilenns
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants