Skip to content

Commit 4ce1360

Browse files
committed
test: improve fixture source readability in fallback case
1 parent 9ea8ea0 commit 4ce1360

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

test/exports-default-fallback.spec.mts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ test('esm wrapper supports default-only dist export shape', async () => {
1010
const wrapperPath = join(tempDir, 'index.mjs');
1111
const fixturePath = join(tempDir, 'dist-fixture.mjs');
1212
const fixtureClassName = 'MockReactRefreshRspackPlugin';
13+
const fixtureSource = `export default class ${fixtureClassName} {
14+
constructor() {
15+
this.options = { reactRefreshLoader: true };
16+
}
17+
}
18+
`;
1319

14-
writeFileSync(
15-
fixturePath,
16-
`export default class ${fixtureClassName} {\n constructor() {\n this.options = { reactRefreshLoader: true };\n }\n}\n`,
17-
);
20+
writeFileSync(fixturePath, fixtureSource);
1821
writeFileSync(
1922
wrapperPath,
2023
wrapperSource.replace('../dist/index.js', './dist-fixture.mjs'),

0 commit comments

Comments
 (0)