Fix plugin loading cache (#14576)

This commit is contained in:
fisker Cheung authored and GitHub committed 2023-03-24 13:19:18 +08:00
1 parent e154250e19
commit fc81cc13cb
13 files changed
+222 -171

No files matched your search

@@ -0,0 +1,21 @@
import prettier from "../../config/prettier-entry.js";
// #13235
test("Plugin instance should not cached", async () => {
expect([
await prettier.format(".", {
plugins: [
{ parsers: { baz: { parse: () => ({}), astFormat: "baz-ast" } } },
{ printers: { "baz-ast": { print: () => "1" } } },
],
parser: "baz",
}),
await prettier.format(".", {
plugins: [
{ parsers: { baz: { parse: () => ({}), astFormat: "baz-ast" } } },
{ printers: { "baz-ast": { print: () => "2" } } },
],
parser: "baz",
}),
]).toEqual(["1", "2"]);
});