Skip to content

Commit a9b42b1

Browse files
test: jssg + node
1 parent 29ac317 commit a9b42b1

14 files changed

Lines changed: 65 additions & 58 deletions

File tree

recipes/correct-ts-specifiers/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"description": "Replace erroneous 'js' or omitted file extensions of import specifiers in TypeScript files.",
55
"type": "module",
66
"scripts": {
7-
"test": "node --no-warnings --experimental-import-meta-resolve --experimental-test-module-mocks --experimental-test-snapshots --experimental-strip-types --import='@nodejs/codemod-utils/snapshots' --test --experimental-test-coverage --test-coverage-include='src/**/*' --test-coverage-exclude='**/*.test.ts' './**/*.test.ts'"
7+
"test": "node --run test:jssg && node --run test:node",
8+
"test:jssg": "npx codemod jssg test --allow-fs -l typescript ./src/workflow.ts ./tests/",
9+
"test:node": "node --no-warnings --experimental-import-meta-resolve --experimental-test-module-mocks --experimental-test-snapshots --experimental-strip-types --import='@nodejs/codemod-utils/snapshots' --test --experimental-test-coverage --test-coverage-include='src/**/*' --test-coverage-exclude='**/*.test.ts' './**/*.test.ts'"
810
},
911
"repository": {
1012
"type": "git",

recipes/correct-ts-specifiers/src/workflow.test.snap.cjs

Lines changed: 0 additions & 3 deletions
This file was deleted.

recipes/correct-ts-specifiers/src/workflow.test.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export class Bird {
2+
constructor(public readonly name: string) {}
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export class Cat {
2+
constructor(public readonly name: string) {}
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export class Dog {
2+
constructor(public readonly name: string) {}
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const baseUrl = new URL('.', import.meta.url);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Bird } from './Bird/index.ts';
2+
import { Cat } from './Cat.ts';
3+
4+
export type { Zed } from './zed.d.ts';
5+
6+
const nil = await import('./nil.ts');
7+
8+
const bird = new Bird('Tweety');
9+
const cat = new Cat('Milo');
10+
11+
console.log('bird:', bird);
12+
console.log('cat:', cat);
13+
console.log('nil:', nil);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Bird } from './Bird';
2+
import { Cat } from './Cat.ts';
3+
4+
export { Zed } from './zed';
5+
6+
const nil = await import('./nil.js');
7+
8+
const bird = new Bird('Tweety');
9+
const cat = new Cat('Milo');
10+
11+
console.log('bird:', bird);
12+
console.log('cat:', cat);
13+
console.log('nil:', nil);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const nil = null;

0 commit comments

Comments
 (0)