2018-01-09 14:27:26 +01:00
|
|
|
describe("parser preprocess function is used to reshape input text", () => {
|
2023-04-11 08:44:23 +08:00
|
|
|
runCli("plugins/preprocess", ["*.foo", "--plugin=./plugin.cjs"], {
|
2018-11-14 07:55:50 -05:00
|
|
|
ignoreLineEndings: true,
|
|
|
|
|
}).test({
|
2023-03-30 14:25:28 +08:00
|
|
|
stdout: "preprocessed:contents",
|
2018-01-09 14:27:26 +01:00
|
|
|
stderr: "",
|
|
|
|
|
status: 0,
|
|
|
|
|
write: [],
|
|
|
|
|
});
|
2025-09-12 05:03:05 +08:00
|
|
|
runCli(
|
|
|
|
|
"plugins/preprocess",
|
|
|
|
|
["*.foo", "--plugin=./plugin-with-async-preprocess.cjs"],
|
|
|
|
|
{
|
|
|
|
|
ignoreLineEndings: true,
|
|
|
|
|
},
|
|
|
|
|
).test({
|
|
|
|
|
stdout: "preprocessed:async:contents",
|
|
|
|
|
stderr: "",
|
|
|
|
|
status: 0,
|
|
|
|
|
write: [],
|
|
|
|
|
});
|
2018-01-09 14:27:26 +01:00
|
|
|
});
|