aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--integration/bunjs-only-snippets/toml-fixture.toml30
-rw-r--r--integration/bunjs-only-snippets/toml.test.js17
2 files changed, 47 insertions, 0 deletions
diff --git a/integration/bunjs-only-snippets/toml-fixture.toml b/integration/bunjs-only-snippets/toml-fixture.toml
new file mode 100644
index 000000000..259891be7
--- /dev/null
+++ b/integration/bunjs-only-snippets/toml-fixture.toml
@@ -0,0 +1,30 @@
+
+framework = "next"
+origin = "http://localhost:5000"
+inline.array = [1234, 4, 5, 6]
+
+
+[macros]
+react-relay = { "graphql" = "node_modules/bun-macro-relay/bun-macro-relay.tsx" }
+
+[bundle.packages]
+"@emotion/react" = true
+
+
+[dev]
+foo = 123
+"foo.bar" = "baz"
+"abba.baba" = "baba"
+dabba = -123
+doo = 123.456
+one.two.three = 4
+
+[[array]]
+entry_one = "one"
+entry_two = "two"
+
+[[array]]
+entry_one = "three"
+
+[[array.nested]]
+entry_one = "four"
diff --git a/integration/bunjs-only-snippets/toml.test.js b/integration/bunjs-only-snippets/toml.test.js
new file mode 100644
index 000000000..5e2d184d8
--- /dev/null
+++ b/integration/bunjs-only-snippets/toml.test.js
@@ -0,0 +1,17 @@
+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");
+});