Open IsaacMcIntyre opened 1 year ago
I get this on ttsc --watch
with a generic custom transformer plugin
import * as ts from 'typescript';
export default function transformer() {
return (_: ts.TransformationContext) => {
return (source: ts.SourceFile) => {
return source
};
};
}
Also added a barebones repo that can reproduce the issue:
https://github.com/malinkie/circular-dep
If you change the transformer to javascript rather than typescript. it works with no errors
I'm seeing the same on Node 20.6 with a custom transformer too:
import * as ts from 'typescript';
function transform<T extends ts.Node>(): ts.TransformerFactory<T> {
return context => {
const visit: ts.Visitor = node => {
// Check for import declarations and filter out .scss files
if (ts.isImportDeclaration(node)) {
const moduleSpecifier = node.moduleSpecifier;
if (ts.isStringLiteral(moduleSpecifier) && moduleSpecifier.text.endsWith('.scss')) {
return undefined; // Remove the import declaration
}
}
return ts.visitEachChild(node, child => visit(child), context);
};
return node => ts.visitNode(node, visit);
};
}
export default transform;
Apologies if this repo is not the right place to post, I wasn't quite sure to post this under ttypescript, or to have it under ts-jest.
I have an issue in where I am seeing many warnings upon running my jest unit tests for my Vue3 project only when ttypescript has been setup as the compiler for ts-jest.
"^.+\\.ts$": ["ts-jest", { compiler: "ttypescript" }],
However, when ttypescript as compiler is removed from jest.config.js (which defaults to typescript instead), the tests mention no warnings. However, in my project I am having to use ts-auto-mock, which requires ttypescript to be used as the ts-jest compiler see here. I have also noticed this only seems to be happening on first run, unless jest cache is disabled.
I have created a barebones Vue3 project with ttypescript setup as ts-jest compiler here to demonstrate the warnings.
While looking into this, I also stumbled onto this discussion which seemed to point the same issue at ttypescript #https://github.com/Swatinem/rollup-plugin-dts/issues/206.
The warning with stacktrace is as follows:
Test Suites: 1 passed, 1 total Tests: 1 passed, 1 total Snapshots: 0 total Time: 2.348 s
Notes: