Skip to content

Commit

Permalink
remove sometimes and ignore others
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpza committed Aug 8, 2024
1 parent 59e6f8d commit 07e1ad7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
8 changes: 1 addition & 7 deletions test/tests/extras.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ describe(`Extra Tests`, () => {
describe(`Built Tests`, () => {
// see: https://github.com/LeDDGroup/typescript-transform-paths/issues/130
test(`Transformer works without ts-node being present`, () => {
jest.doMock(
"ts-node",
() => {
require("sdf0s39rf3333d@fake-module");
},
{ virtual: true },
);
jest.doMock("ts-node", () => ({}), { virtual: true });
try {
const program = createTsProgram({ tsInstance: ts, tsConfigFile }, config.builtTransformerPath);
const res = getEmitResultFromProgram(program);
Expand Down
8 changes: 1 addition & 7 deletions test/tests/register.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,7 @@ describe(`Register script`, () => {

describe(`Register`, () => {
test(`Throws without ts-node`, () => {
jest.doMock(
"ts-node",
() => {
require("sdf0s39rf3333d@fake-module");
},
{ virtual: true },
);
jest.doMock("ts-node", () => ({}), { virtual: true });
expect(() => register()).toThrow(`Cannot resolve ts-node`);
jest.dontMock("ts-node");
});
Expand Down
1 change: 1 addition & 0 deletions test/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export function getTsNodeEmitResult(
const compiler = tsNode.create({
transpileOnly: true,
transformers: {
// eslint-disable-next-line @typescript-eslint/no-require-imports
before: [tstpTransform(void 0, pluginConfig, <any>{ ts: require(tsSpecifier) })],
},
project: pcl.options.configFilePath,
Expand Down

0 comments on commit 07e1ad7

Please sign in to comment.