aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/toml.test.js
blob: ecf0f5f8a00f3f144426ecc97b3b31c15a5c5b84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { describe, it, expect } from "bun:test";

it("syntax", async () => {
  const toml = (await import("./toml-fixture.toml")).default;
  expect(toml.framework).toBe("next");
  expect(toml.bundle.packages["@emotion/react"]).toBe(true);
  expect(toml.array[0].entry_one).toBe("one");
  expect(toml.array[0].entry_two).toBe("two");
  expect(toml.array[1].entry_one).toBe("three");
  expect(toml.array[1].entry_two).toBe(undefined);
  expect(toml.array[1].nested[0].entry_one).toBe("four");
  expect(toml.dev.one.two.three).toBe(4);
  expect(toml.dev.foo).toBe(123);
  expect(toml.inline.array[0]).toBe(1234);
  expect(toml.inline.array[1]).toBe(4);
  expect(toml.dev["foo.bar"]).toBe("baz");
  expect(toml.install.scopes["@mybigcompany"].url).toBe(
    "https://registry.mybigcompany.com"
  );
  expect(toml.install.scopes["@mybigcompany2"].url).toBe(
    "https://registry.mybigcompany.com"
  );
  expect(toml.install.scopes["@mybigcompany3"].three).toBe(4);
});