summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Van Doorn <vandoorn.nick@gmail.com>2019-01-19 21:58:52 -0800
committerNick Van Doorn <vandoorn.nick@gmail.com>2019-01-19 21:58:52 -0800
commit0837abc5f0bd61753662d6c02a241e2f88b8f94f (patch)
treee5acf821e74f4ad709f2c3de382032618a3a39f9 /src
parente8d64fb823a73d1297d151b4ebd0d05b86c97a0b (diff)
Test reading/writing to root node
Diffstat (limited to 'src')
-rw-r--r--src/database.test.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/database.test.ts b/src/database.test.ts
index de05b2c..4b296ba 100644
--- a/src/database.test.ts
+++ b/src/database.test.ts
@@ -49,6 +49,19 @@ describe("Database module", () => {
expect(s).toBe(toWrite);
});
+ test("it should write and read data from the root", async () => {
+ const toWrite = {
+ my: {
+ big: {
+ fun: "data"
+ }
+ }
+ };
+ await db.write("/", toWrite);
+ const s = await db.read("/");
+ expect(s).toEqual(toWrite);
+ });
+
test("it should remove data", async () => {
const path = "/this/is/fun";
await db.write(path, {