Skip to content

Commit 6ba106b

Browse files
authored
Merge pull request #226 from Teamwork/update-mocha
Update mocha and fix 2 tests
2 parents 01fa1b5 + d5a03f3 commit 6ba106b

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
language: node_js
22
node_js:
33
- "10"
4-
- "9"
54
- "8"
65
- "6"
7-
- "4"
8-
script: "npm run jshint && npm run test-cover"
6+
script: "ln -s .. node_modules/sharedb; npm run jshint && npm run test-cover"
97
# Send coverage data to Coveralls
108
after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"expect.js": "^0.3.1",
1717
"istanbul": "^0.4.2",
1818
"jshint": "^2.9.2",
19-
"mocha": "^3.2.0",
19+
"mocha": "^5.2.0",
2020
"sharedb-mingo-memory": "^1.0.0-beta"
2121
},
2222
"scripts": {

test/client/submit.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,16 @@ describe('client submit', function() {
608608
doc2.del(function(err) {
609609
if (err) return done(err);
610610
doc.pause();
611+
var calledBack = false;
612+
doc.on('error', function() {
613+
expect(calledBack).equal(true);
614+
done();
615+
});
611616
doc.submitOp({p: ['age'], na: 1}, function(err) {
612617
expect(err).ok();
613618
expect(doc.version).equal(2);
614619
expect(doc.data).eql(undefined);
615-
done();
620+
calledBack = true;
616621
});
617622
doc.fetch();
618623
});
@@ -632,11 +637,16 @@ describe('client submit', function() {
632637
doc2.create({age: 5}, function(err) {
633638
if (err) return done(err);
634639
doc.pause();
640+
var calledBack = false;
641+
doc.on('error', function() {
642+
expect(calledBack).equal(true);
643+
done();
644+
});
635645
doc.create({age: 9}, function(err) {
636646
expect(err).ok();
637647
expect(doc.version).equal(3);
638648
expect(doc.data).eql({age: 5});
639-
done();
649+
calledBack = true;
640650
});
641651
doc.fetch();
642652
});

0 commit comments

Comments
 (0)