test: add awaits to rejects and resolves
This commit is contained in:
parent
84d7da0195
commit
826dc1062a
4 changed files with 6 additions and 6 deletions
|
|
@ -108,14 +108,14 @@ test("strips leading './' from outdir", async () => {
|
|||
// --- promise settlement ------------------------------------------------------
|
||||
test("resolves with 'Done' when execFile succeeds", async () => {
|
||||
behavior = { kind: "success", stdout: "fine", stderr: "" };
|
||||
expect(convert("in.txt", "txt", "docx", "out/out.docx", undefined, mockExecFile)).resolves.toBe(
|
||||
await expect(convert("in.txt", "txt", "docx", "out/out.docx", undefined, mockExecFile)).resolves.toBe(
|
||||
"Done",
|
||||
);
|
||||
});
|
||||
|
||||
test("rejects when execFile returns an error", async () => {
|
||||
behavior = { kind: "error", message: "convert failed", stderr: "oops" };
|
||||
expect(convert("in.txt", "txt", "docx", "out/out.docx", undefined, mockExecFile)).rejects.toMatch(
|
||||
await expect(convert("in.txt", "txt", "docx", "out/out.docx", undefined, mockExecFile)).rejects.toMatch(
|
||||
/error: Error: convert failed/,
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue