More tests for the Notes model

That wasn't enough to test much, so let's go ahead and add some more tests:

describe("read note", function() {    it("should have proper note", async function() {        const note = await model.read("n1");        assert.exists(note);        assert.deepEqual({ key: note.key, title: note.title, body:         note.body }, {          key: "n1", title: "Note 1 FAIL", body: "Note 1"        });    });        it("Unknown note should fail", async function() {        try {          const note = await model.read("badkey12");          assert.notExists(note);          throw new Error("should not get here");        } catch(err) {          // this is expected, so do not indicate error          assert.notEqual(err.message, "should not get here");        }    });});

describe("change note", function() { it("after a successful model.update", async ...

Get Node.js Web Development - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.