diff options
| author | Asko Nõmm <asko@nmm.ee> | 2025-01-12 15:19:15 +0200 |
|---|---|---|
| committer | Asko Nõmm <asko@nmm.ee> | 2025-01-12 15:19:15 +0200 |
| commit | 6a075eac5ee63d735691545af90ac6d3f3f7ff8f (patch) | |
| tree | f74625aede60252fdca71f3c7cd8791703018180 /src/serializers/to_object.test.ts | |
| parent | 1a908bb7aae140b5c556c6b4e903b803820429dc (diff) | |
Bump
Diffstat (limited to 'src/serializers/to_object.test.ts')
| -rw-r--r-- | src/serializers/to_object.test.ts | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/src/serializers/to_object.test.ts b/src/serializers/to_object.test.ts index d3d2255..98b165a 100644 --- a/src/serializers/to_object.test.ts +++ b/src/serializers/to_object.test.ts @@ -3,35 +3,39 @@ import FlatMatter from "../flatmatter.ts"; import ToObject from "./to_object.ts"; Deno.test("Single-level configuration", () => { - const fm = new FlatMatter("a: true\nb: false\nc: 1\nd: 12.5\nf: \"some string\"") + const fm = new FlatMatter( + 'a: true\nb: false\nc: 1\nd: 12.5\nf: "some string"', + ); - assertEquals(fm.serialize(new ToObject), { - a: true, - b: false, - c: 1, - d: 12.5, - f: "some string" - }); + assertEquals(fm.serialize(new ToObject()), { + a: true, + b: false, + c: 1, + d: 12.5, + f: "some string", + }); }); Deno.test("Two-level configuration", () => { - const fm = new FlatMatter("a.a: true\nb.b: false\nc.c: 1\nd.d: 12.5\nf.f: \"some string\"") + const fm = new FlatMatter( + 'a.a: true\nb.b: false\nc.c: 1\nd.d: 12.5\nf.f: "some string"', + ); - assertEquals(fm.serialize(new ToObject), { - a: { - a: true, - }, - b: { - b: false, - }, - c: { - c: 1 - }, - d: { - d: 12.5 - }, - f: { - f: "some string" - } - }); -})
\ No newline at end of file + assertEquals(fm.serialize(new ToObject()), { + a: { + a: true, + }, + b: { + b: false, + }, + c: { + c: 1, + }, + d: { + d: 12.5, + }, + f: { + f: "some string", + }, + }); +}); |
