Skip to content

Commit eba7859

Browse files
committed
Update tests
1 parent 3ad3a1f commit eba7859

21 files changed

+46
-72
lines changed

packages/cross-import/jest.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/** @type {import('jest').Config} */
22
export default {
3-
preset: '@techor/jest'
3+
preset: '@techor/jest',
4+
transformIgnorePatterns: [
5+
'node_modules/(?!callsites)/',
6+
/* should simulate real node runtime */
7+
'fixtures/'
8+
]
49
}

packages/cross-import/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"build:type": "tsc --emitDeclarationOnly --preserveWatchOutput",
77
"build": "pnpm run \"/^build:.*/\"",
88
"dev": "pnpm run \"/^build:.*/\" --watch",
9-
"test": "pnpm build:main && node ./tests/real.mjs && jest",
9+
"test": "jest",
1010
"type-check": "tsc --noEmit",
1111
"lint": "eslint src"
1212
},
@@ -64,6 +64,6 @@
6464
},
6565
"devDependencies": {
6666
"@master/css": "2.0.0-rc.24",
67-
"pretty-bytes": "^6.1.0"
67+
"nanoid": "^5.0.7"
6868
}
6969
}

packages/cross-import/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export default function crossImport(modulePath: string): any {
1919
console.log('[cross-import] fall back to sucrase runtime transform:', modulePath)
2020
}
2121
return jiti(__filename, {
22-
interopDefault: true,
2322
cache: false,
2423
debug: !!process.env.DEBUG,
2524
onError(error) {

packages/cross-import/tests/external.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import crossImport from '../src'
33

44
it('read module with third-party deps', () => {
55
expect(
6-
crossImport(resolve(__dirname, 'external.ts')).default
6+
crossImport(resolve(__dirname, 'fixtures/external.ts')).default
77
)
88
.toBeDefined()
99
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export { default } from 'pretty-bytes'
1+
export { nanoid as default } from 'nanoid'
22
export * from './bar'
33
export const foo = 'foo'

0 commit comments

Comments
 (0)