Skip to content

Commit f14ea2c

Browse files
committed
test: simplify explicit config path coverage
1 parent f89affd commit f14ea2c

3 files changed

Lines changed: 4 additions & 20 deletions

File tree

packages/rstack/tests/config/load-config/explicit-dependency.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
import { define } from 'rstack';
2-
import { title } from './explicit-dependency.ts';
32

4-
define.app({
5-
html: {
6-
title,
7-
},
8-
});
3+
define.app({});

packages/rstack/tests/config/load-config/index.test.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,10 @@ test('should reset config state before and after loading', async () => {
1919

2020
test('should prefer an explicit config path over the state config path', async () => {
2121
const configFilePath = path.join(import.meta.dirname, 'explicit.config.ts');
22-
const dependencyPath = path.join(import.meta.dirname, 'explicit-dependency.ts');
23-
const relativeConfigPath = path.relative(process.cwd(), configFilePath);
2422
state.configPath = path.join(import.meta.dirname, 'rstack.config.ts');
2523

26-
const loaded = await loadRstackConfig({
27-
configFilePath: relativeConfigPath,
28-
});
24+
const { configs, filePath } = await loadRstackConfig({ configFilePath });
2925

30-
expect(loaded.configs.app).toEqual({
31-
html: {
32-
title: 'explicit config works',
33-
},
34-
});
35-
expect(loaded.filePath).toBe(configFilePath);
36-
expect(loaded.dependencies).toEqual([dependencyPath]);
37-
expect(state.configs).toEqual({});
26+
expect(configs.app).toEqual({});
27+
expect(filePath).toBe(configFilePath);
3828
});

0 commit comments

Comments
 (0)