File size: 510 Bytes
2d661b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { describe, expect, it } from "vitest";
import { type ExecutionError, isUserError } from "./errors";

describe("Execution Errors", () => {
	it("isUserError should return true by default", () => {
		expect(isUserError(new Error("test"))).toBe(true);
	});

	it("should define ExecutionError interface", () => {
		const err: ExecutionError = {
			type: "UserError",
			message: "Something went wrong",
		};
		expect(err.type).toBe("UserError");
		expect(err.message).toBe("Something went wrong");
	});
});