Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve compatibility with native Node CJS resolution (#2226)
* fix: improve compatibility with native Node CJS resolution * chore: types * test: increase stacktrace timeout
- Loading branch information
1 parent
a1ee96a
commit fe71946
Showing
5 changed files
with
37 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
'use strict' | ||
exports.default = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare const defaultExports: { | ||
default: number | ||
} | ||
|
||
export default defaultExports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { describe, expect, it } from 'vitest' | ||
|
||
import * as other from '../src/other.cjs' | ||
import defaultOther from '../src/other.cjs' | ||
|
||
describe('correctly identified named default', () => { | ||
it('default should be on default', () => { | ||
expect(other.default).toBe(defaultOther) | ||
}) | ||
|
||
it('default is an object with default', () => { | ||
expect(other.default).toMatchObject({ default: 2 }) | ||
expect(defaultOther).toMatchObject({ default: 2 }) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters