Files
bun.sh/packages/bun-plugin-yaml/index.test.ts
Colin McDonnell a52715597a Add plugins for yaml & RSC (#2888)
* WIP

* WIP

* Add yaml plugin

* Publish v0.0.1

* Updates

* Start RSC plugin - not finished

* Add readme

* Updates

* Add shell dirs for a few other plugins
2023-05-15 20:37:03 -07:00

22 lines
534 B
TypeScript

import { test, expect } from "bun:test";
import YamlPlugin from ".";
import data from "./data.yml";
test("yaml loader - no plugin", async () => {
expect(async () => {
await import("./data.yml");
}).toThrow();
});
test("yaml loader", async () => {
const plugin = YamlPlugin();
Bun.plugin(plugin);
const { default: mod } = await import("./data.yml");
expect(mod.doe).toEqual("a deer, a female deer");
expect(mod.ray).toEqual("a drop of golden sun");
expect(mod.pi).toEqual(3.14159);
Bun.plugin.clearAll();
});