2018-02-27 14:20:02 +01:00
|
|
|
describe("plugin default options should work", () => {
|
2023-04-11 08:44:23 +08:00
|
|
|
runCli(
|
2018-02-27 14:20:02 +01:00
|
|
|
"plugins/defaultOptions",
|
2020-01-14 18:54:26 +08:00
|
|
|
[
|
|
|
|
|
"--stdin-filepath",
|
|
|
|
|
"example.foo",
|
2021-12-03 15:41:12 +08:00
|
|
|
"--plugin=./plugin.cjs",
|
2020-01-14 18:54:26 +08:00
|
|
|
"--no-editorconfig",
|
|
|
|
|
],
|
2018-02-27 14:20:02 +01:00
|
|
|
{ input: "hello-world" },
|
|
|
|
|
).test({
|
2019-09-12 08:52:48 -07:00
|
|
|
stdout: JSON.stringify({
|
|
|
|
|
tabWidth: 8,
|
|
|
|
|
bracketSpacing: false,
|
|
|
|
|
}),
|
2018-02-27 14:20:02 +01:00
|
|
|
stderr: "",
|
|
|
|
|
status: 0,
|
|
|
|
|
write: [],
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
describe("overriding plugin default options should work", () => {
|
2023-04-11 08:44:23 +08:00
|
|
|
runCli(
|
2018-02-27 14:20:02 +01:00
|
|
|
"plugins/defaultOptions",
|
2021-12-03 15:41:12 +08:00
|
|
|
[
|
|
|
|
|
"--stdin-filepath",
|
|
|
|
|
"example.foo",
|
|
|
|
|
"--plugin=./plugin.cjs",
|
|
|
|
|
"--tab-width=4",
|
|
|
|
|
],
|
2018-02-27 14:20:02 +01:00
|
|
|
{ input: "hello-world" },
|
|
|
|
|
).test({
|
2019-09-12 08:52:48 -07:00
|
|
|
stdout: JSON.stringify({
|
|
|
|
|
tabWidth: 4,
|
|
|
|
|
bracketSpacing: false,
|
|
|
|
|
}),
|
2018-02-27 14:20:02 +01:00
|
|
|
stderr: "",
|
|
|
|
|
status: 0,
|
|
|
|
|
write: [],
|
|
|
|
|
});
|
|
|
|
|
});
|