Skip to content

Commit e00ed88

Browse files
committed
chore: update tests
1 parent 8e040f2 commit e00ed88

8 files changed

+96
-79
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"@rspack/core": "1.0.0-alpha.5",
162162
"astro": ">=3",
163163
"esbuild": "*",
164-
"rolldown": "^0.12.1",
164+
"rolldown": "0.12.1",
165165
"rollup": ">=3",
166166
"vite": ">=3",
167167
"webpack": "^4 || ^5"
@@ -209,7 +209,7 @@
209209
"@types/node": "^20.14.10",
210210
"esbuild": "^0.23.0",
211211
"eslint": "^9.7.0",
212-
"rolldown": "^0.12.2",
212+
"rolldown": "0.12.1",
213213
"rollup": "^4.19.0",
214214
"tsup": "^8.2.3",
215215
"typescript": "^5.5.4",

pnpm-lock.yaml

+49-58
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/__snapshots__/esbuild.test.ts.snap

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
exports[`expect yaml import to be a json object 1`] = `
44
"var yaml_config_default = { "pluginDir": "./plugins", "web": { "enabled": true }, "logging": { "type": "stdout", "level": "info" } };
5-
export {
6-
yaml_config_default as default
7-
};
5+
6+
console.log(yaml_config_default);
87
"
98
`;
109

@@ -17,9 +16,8 @@ console.log(yaml_config_default);
1716

1817
exports[`expect yml import to be a json object 1`] = `
1918
"var yml_config_default = { "pluginDir": "./plugins", "web": { "enabled": true }, "logging": { "type": "stdout", "level": "info" } };
20-
export {
21-
yml_config_default as default
22-
};
19+
20+
console.log(yml_config_default);
2321
"
2422
`;
2523

+31-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,47 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3+
exports[`expect yaml import to be a json object 1`] = `
4+
"
5+
var yaml_config_default = {
6+
'pluginDir': './plugins',
7+
'web': {'enabled': true},
8+
'logging': {
9+
'type': 'stdout',
10+
'level': 'info'
11+
}
12+
};
13+
14+
console.log(yaml_config_default);
15+
"
16+
`;
17+
318
exports[`expect yaml import to be a string 1`] = `
419
"
5-
var yaml_config_default = "pluginDir: ./plugins\\n\\nweb:\\n enabled: true\\n\\nlogging:\\n type: stdout\\n level: info\\n";
20+
var yaml_config_default = 'pluginDir: ./plugins\\n\\nweb:\\n enabled: true\\n\\nlogging:\\n type: stdout\\n level: info\\n';
621
722
console.log(yaml_config_default);
23+
"
24+
`;
25+
26+
exports[`expect yml import to be a json object 1`] = `
27+
"
28+
var yml_config_default = {
29+
'pluginDir': './plugins',
30+
'web': {'enabled': true},
31+
'logging': {
32+
'type': 'stdout',
33+
'level': 'info'
34+
}
35+
};
836
37+
console.log(yml_config_default);
938
"
1039
`;
1140

1241
exports[`expect yml import to be a string 1`] = `
1342
"
14-
var yml_config_default = "pluginDir: ./plugins\\n\\nweb:\\n enabled: true\\n\\nlogging:\\n type: stdout\\n level: info\\n";
43+
var yml_config_default = 'pluginDir: ./plugins\\n\\nweb:\\n enabled: true\\n\\nlogging:\\n type: stdout\\n level: info\\n';
1544
1645
console.log(yml_config_default);
17-
1846
"
1947
`;

test/__snapshots__/rollup.test.ts.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`expect yaml import to be a json object 1`] = `
4-
"var yamlConfig = {"pluginDir":"./plugins","web":{"enabled":true},"logging":{"type":"stdout","level":"info"}};
4+
"var config = {"pluginDir":"./plugins","web":{"enabled":true},"logging":{"type":"stdout","level":"info"}};
55
6-
export { yamlConfig as default };
6+
console.log(config);
77
"
88
`;
99

@@ -15,9 +15,9 @@ console.log(config);
1515
`;
1616

1717
exports[`expect yml import to be a json object 1`] = `
18-
"var ymlConfig = {"pluginDir":"./plugins","web":{"enabled":true},"logging":{"type":"stdout","level":"info"}};
18+
"var config = {"pluginDir":"./plugins","web":{"enabled":true},"logging":{"type":"stdout","level":"info"}};
1919
20-
export { ymlConfig as default };
20+
console.log(config);
2121
"
2222
`;
2323

test/esbuild.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { removeComments } from "./utils";
66
it("expect yaml import to be a json object", async () => {
77
const result = await build({
88
entryPoints: [
9-
"./test/fixtures/yaml-config.yaml",
9+
"./test/fixtures/js-yaml.js",
1010
],
1111
format: "esm",
1212
write: false,
@@ -40,7 +40,7 @@ it("expect yaml import to be a string", async () => {
4040
it("expect yml import to be a json object", async () => {
4141
const result = await build({
4242
entryPoints: [
43-
"./test/fixtures/yml-config.yml",
43+
"./test/fixtures/js-yml.js",
4444
],
4545
format: "esm",
4646
write: false,

test/rolldown.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { removeComments } from "./utils";
55

66
it("expect yaml import to be a json object", async () => {
77
const bundle = await rolldown({
8-
input: "./test/fixtures/yaml-config.yaml",
8+
input: "./test/fixtures/js-yaml.js",
99
plugins: [
1010
YAMLPlugin(),
1111
],
@@ -35,7 +35,7 @@ it("expect yaml import to be a string", async () => {
3535

3636
it("expect yml import to be a json object", async () => {
3737
const bundle = await rolldown({
38-
input: "./test/fixtures/yml-config.yml",
38+
input: "./test/fixtures/js-yml.js",
3939
plugins: [
4040
YAMLPlugin(),
4141
],

test/rollup.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { removeComments } from "./utils";
55

66
it("expect yaml import to be a json object", async () => {
77
const bundle = await rollup({
8-
input: "./test/fixtures/yaml-config.yaml",
8+
input: "./test/fixtures/js-yaml.js",
99
plugins: [
1010
YAMLPlugin(),
1111
],
@@ -35,7 +35,7 @@ it("expect yaml import to be a string", async () => {
3535

3636
it("expect yml import to be a json object", async () => {
3737
const bundle = await rollup({
38-
input: "./test/fixtures/yml-config.yml",
38+
input: "./test/fixtures/js-yml.js",
3939
plugins: [
4040
YAMLPlugin(),
4141
],

0 commit comments

Comments
 (0)