Fix plugin loading cache (#14576)
This commit is contained in:
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"]);
|
||||
});
|
||||
Reference in new issue
Block a user