Skip to content

Commit 5683ed0

Browse files
committed
f
1 parent f1c1bc7 commit 5683ed0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/import.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ function getRequire() {
3232
return _customRequire;
3333
}
3434

35+
export function getExtensions() {
36+
return getRequire().extensions;
37+
}
38+
3539
let _supportTypeScript: boolean | undefined;
3640
export function isSupportTypeScript() {
3741
if (_supportTypeScript === undefined) {
38-
const extensions = getRequire().extensions;
42+
const extensions = getExtensions();
3943
_supportTypeScript = extensions['.ts'] !== undefined || process.env.VITEST === 'true';
4044
debug('[isSupportTypeScript] %o, extensions: %j, process.env.VITEST: %j',
4145
_supportTypeScript, Object.keys(extensions), process.env.VITEST);

test/index.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ describe('test/index.test.ts', () => {
3838
'default',
3939
'detectType',
4040
'getConfig',
41+
'getExtensions',
4142
'getFrameworkOrEggPath',
4243
'getFrameworkPath',
4344
'getLoadUnits',

0 commit comments

Comments
 (0)