fix(tui): fix flaky plugin test
parent
a76be695c7
commit
cd1eb619dc
|
|
@ -479,11 +479,11 @@ test("continues loading when a plugin is missing config metadata", async () => {
|
||||||
try {
|
try {
|
||||||
await TuiPluginRuntime.init(createTuiPluginApi())
|
await TuiPluginRuntime.init(createTuiPluginApi())
|
||||||
// bad plugin was skipped (no metadata entry)
|
// bad plugin was skipped (no metadata entry)
|
||||||
await expect(fs.readFile(path.join(tmp.path, "bad.txt"), "utf8")).rejects.toThrow()
|
expect(await fs.readFile(path.join(tmp.path, "bad.txt"), "utf8")).rejects.toThrow()
|
||||||
// good plugin loaded fine
|
// good plugin loaded fine
|
||||||
await expect(fs.readFile(tmp.extra.goodMarker, "utf8")).resolves.toBe("called")
|
expect(await fs.readFile(tmp.extra.goodMarker, "utf8")).resolves.toBe("called")
|
||||||
// bare string spec gets undefined options
|
// bare string spec gets undefined options
|
||||||
await expect(fs.readFile(tmp.extra.bareMarker, "utf8")).resolves.toBe("undefined")
|
expect(await fs.readFile(tmp.extra.bareMarker, "utf8")).resolves.toBe("undefined")
|
||||||
} finally {
|
} finally {
|
||||||
await TuiPluginRuntime.dispose()
|
await TuiPluginRuntime.dispose()
|
||||||
cwd.mockRestore()
|
cwd.mockRestore()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue