mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
18 lines
703 B
TypeScript
18 lines
703 B
TypeScript
import { describe, it, expect } from "bun:test";
|
|
import { SveltePlugin } from "./index";
|
|
|
|
describe("SveltePlugin", () => {
|
|
it.each([true, false, 0, 1, "hi"])("throws if passed a non-object (%p)", (badOptions: any) => {
|
|
expect(() => SveltePlugin(badOptions)).toThrow(TypeError);
|
|
});
|
|
it("may be nullish or not provided", () => {
|
|
expect(() => SveltePlugin()).not.toThrow();
|
|
expect(() => SveltePlugin(null as any)).not.toThrow();
|
|
expect(() => SveltePlugin(undefined)).not.toThrow();
|
|
});
|
|
|
|
it.each([null, 1, "hi", {}, "Client"])("throws if forceSide is not 'client' or 'server' (%p)", (forceSide: any) => {
|
|
expect(() => SveltePlugin({ forceSide })).toThrow(TypeError);
|
|
});
|
|
});
|