Skip to content

Commit a0fb1f8

Browse files
committed
chore: update
1 parent 59a8220 commit a0fb1f8

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

tests/integration/cli/index.test.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,29 @@ test('inspect command', async () => {
1212
cwd: __dirname,
1313
});
1414

15-
const files = await globContentJSON(path.join(__dirname, 'dist'));
16-
const fileNames = Object.keys(files);
15+
const files = await globContentJSON(path.join(__dirname, 'dist/.rsbuild'));
16+
const fileNames = Object.keys(files).sort();
1717

18-
const rsbuildConfig = fileNames.find((item) =>
19-
item.includes('rsbuild.config.mjs'),
20-
);
18+
expect(fileNames).toMatchInlineSnapshot(`
19+
[
20+
"<ROOT>/tests/integration/cli/dist/.rsbuild/rsbuild.config.cjs.mjs",
21+
"<ROOT>/tests/integration/cli/dist/.rsbuild/rsbuild.config.esm.mjs",
22+
"<ROOT>/tests/integration/cli/dist/.rsbuild/rspack.config.cjs.mjs",
23+
"<ROOT>/tests/integration/cli/dist/.rsbuild/rspack.config.esm.mjs",
24+
]
25+
`);
2126

22-
expect(rsbuildConfig).toBeTruthy();
23-
expect(files[rsbuildConfig!]).toContain("type: 'modern-module'");
27+
// esm rsbuild config
28+
const rsbuildConfigEsm = fileNames.find((item) =>
29+
item.includes('rsbuild.config.esm.mjs'),
30+
);
31+
expect(rsbuildConfigEsm).toBeTruthy();
32+
expect(files[rsbuildConfigEsm!]).toContain("type: 'modern-module'");
2433

25-
const rspackConfig = fileNames.find((item) =>
34+
// esm rspack config
35+
const rspackConfigEsm = fileNames.find((item) =>
2636
item.includes('rspack.config.esm.mjs'),
2737
);
28-
expect(rspackConfig).toBeTruthy();
29-
expect(files[rspackConfig!]).toContain("type: 'modern-module'");
38+
expect(rspackConfigEsm).toBeTruthy();
39+
expect(files[rspackConfigEsm!]).toContain("type: 'modern-module'");
3040
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from '@rslib/core';
2-
import { generateBundleEsmConfig } from 'test-helper';
2+
import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper';
33

44
export default defineConfig({
5-
lib: [generateBundleEsmConfig()],
5+
lib: [generateBundleEsmConfig(), generateBundleCjsConfig()],
66
});

0 commit comments

Comments
 (0)