UNPKG

@x5e/gink

Version:

an eventually consistent database

22 lines 933 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Accumulator_1 = require("../implementation/Accumulator"); const index_1 = require("../implementation/index"); const utils_1 = require("../implementation/utils"); it("basic accumulator operation", async function () { // set up the objects for (const store of [ new index_1.IndexedDbStore("Accumulator.test1", true), new index_1.MemoryStore(true), ]) { const instance = new index_1.Database({ store }); await instance.ready; const accumulator = await Accumulator_1.Accumulator.create(instance); // set a value await accumulator.addNumber(3.7); // check that the desired result exists in the database const result = await accumulator.getNumber(); (0, utils_1.ensure)(result === 3.7, `result is ${result}`); } }); //# sourceMappingURL=Accumulator.test.js.map