Skip to content

Commit 592b94d

Browse files
committed
chore: update
1 parent 37c3045 commit 592b94d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/integration/auto-external/index.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,26 @@ test('should get warn when use require in ESM', async () => {
9191

9292
const shouldWarn = ['react', 'e2', 'e3', 'e5', 'e6', 'e7'];
9393
const shouldNotWarn = ['e1', 'e4', 'e8', 'lodash/add', 'lodash/drop'];
94+
const issuer = join(fixturePath, 'src/index.ts');
9495

9596
for (const item of shouldWarn) {
9697
expect(entries.esm).toContain(
9798
`import * as __WEBPACK_EXTERNAL_MODULE_${item}__ from "${item}"`,
9899
);
99100
}
100101

101-
for (const item of shouldWarn) {
102+
for (const request of shouldWarn) {
102103
expect(
103104
logStrings.some((l) =>
104-
l.includes(stripAnsi(composeModuleImportWarn(item))),
105+
l.includes(stripAnsi(composeModuleImportWarn(request, issuer))),
105106
),
106107
).toBe(true);
107108
}
108109

109-
for (const item of shouldNotWarn) {
110+
for (const request of shouldNotWarn) {
110111
expect(
111112
logStrings.some((l) =>
112-
l.includes(stripAnsi(composeModuleImportWarn(item))),
113+
l.includes(stripAnsi(composeModuleImportWarn(request, issuer))),
113114
),
114115
).toBe(false);
115116
}

0 commit comments

Comments
 (0)