mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(store) add
This commit is contained in:
parent
fe0210d573
commit
ea297fc23e
5 changed files with 65 additions and 37 deletions
22
test/common/store.js
Normal file
22
test/common/store.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
const dir = '../../common';
|
||||
const store = require(`${dir}/store`);
|
||||
const test = require('tape');
|
||||
|
||||
test('cloudcmd: common: store: set', (t) => {
|
||||
const name = store();
|
||||
const str = 'hello';
|
||||
name(str);
|
||||
|
||||
t.equal(name(), str, 'should return stored value');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: common: store: first get', (t) => {
|
||||
const name = store();
|
||||
|
||||
t.equal(name(), undefined, 'should return undefined');
|
||||
t.end();
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue