-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest.js
More file actions
27 lines (21 loc) · 717 Bytes
/
test.js
File metadata and controls
27 lines (21 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var chai = require('chai'),
chaiAsPromised = require('chai-as-promised'),
expect = chai.expect;
var Storage = require('./storage');
chai.use(chaiAsPromised);
describe('Storage', function() {
beforeEach(function() {
this.storage = new Storage();
return this.storage.setup();
});
afterEach(function() {
this.storage.disconnect();
});
it('should populate storage without an error', function() {
return expect(this.storage.populate(1234)).to.be.fulfilled;
});
it('should retrieve correct value after being populated', function() {
var promise = this.storage.populate(1234).then(this.storage.score.bind(this.storage));
return expect(promise).to.become(1234);
});
});