UNPKG

memory-card

Version:

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

25 lines 1.14 kB
#!/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 obs_js_1 = require("./obs.js"); const fixtures_js_1 = require("../../tests/fixtures.js"); tstest_1.test.skip('huawei obs storage smoke testing', async (t) => { const EXPECTED_PAYLOAD = { mol: 42 }; const NAME = Math.random().toString().substr(2); const s3 = new obs_js_1.StorageObs(NAME, { accessKeyId: fixtures_js_1.OBS_SETTING.ACCESS_KEY_ID, bucket: fixtures_js_1.OBS_SETTING.BUCKET, secretAccessKey: fixtures_js_1.OBS_SETTING.SECRET_ACCESS_KEY, server: fixtures_js_1.OBS_SETTING.SERVER, }); let empty = await s3.load(); t.same(empty, {}, 'should get back a empty object for non-exist data'); await s3.save(EXPECTED_PAYLOAD); const payload = await s3.load(); t.same(payload, EXPECTED_PAYLOAD, 'should get back data from obs'); await s3.destroy(); empty = await s3.load(); t.same(empty, {}, 'should get back a empty object after destroy()'); }); //# sourceMappingURL=obs.spec.js.map