UNPKG

memory-card

Version:

ES6 Map like Async API, with Swagger API Backend Support.

21 lines 924 B
#!/usr/bin/env -S node --no-warnings --loader ts-node/esm "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tstest_1 = require("tstest"); const etcd_js_1 = require("./etcd.js"); (0, tstest_1.test)('etcd storage smoke testing', async (t) => { const EXPECTED_PAYLOAD = { mol: 42 }; const NAME = 'tmp/memory-card-unit-test-' + Math.random().toString().substr(2); const etcd = new etcd_js_1.StorageEtcd(NAME, { hosts: '127.0.0.1:2379', }); let empty = await etcd.load(); t.same(empty, {}, 'should get back a empty object for non-exist data'); await etcd.save(EXPECTED_PAYLOAD); const payload = await etcd.load(); t.same(payload, EXPECTED_PAYLOAD, 'should get back data from s3'); await etcd.destroy(); empty = await etcd.load(); t.same(empty, {}, 'should get back a empty object after destroy()'); }); //# sourceMappingURL=etcd.spec.js.map