Skip to content

Commit

Permalink
Update test packages
Browse files Browse the repository at this point in the history
The project was using a very old version of Mocah and should packages.
This brings them up to the current stable versions of each.  This
actually exposed a mistake in the tests as written, which forgot to
properly close the Opened Captions server before declaring the tests
over in some cases.

The tests still have an issue, which also exposes a mistake that will
need to be fixed in a separate commit.

Issue #15 Modernize development environment
  • Loading branch information
slifty committed Nov 15, 2018
1 parent 1843b8d commit d921b2c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"uuid": "^3.0.0"
},
"devDependencies": {
"mocha": "^2.2.4",
"should": "^6.0.1"
"mocha": "^5.2.0",
"should": "^13.2.3"
},
"description": "A distributed API for closed captioning live-streams.",
"main": "index.js",
Expand Down
12 changes: 12 additions & 0 deletions test/unit/abstract.stream.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('The abstract stream', function() {
oc.addStream('abstract');
var stream = oc.getStreams().pop();
assert.not.exists(stream.getCursor("custom"));
oc.close();
done();
});

Expand All @@ -27,6 +28,7 @@ describe('The abstract stream', function() {
var stream = oc.getStreams().pop();
assert.exists(stream.getCursor("word"));
stream.getCursor("word").should.equal(0);
oc.close();
done();
});

Expand All @@ -36,6 +38,7 @@ describe('The abstract stream', function() {
var stream = oc.getStreams().pop();
assert.exists(stream.getCursor("base"));
stream.getCursor("base").should.equal(0);
oc.close();
done();
});

Expand All @@ -46,6 +49,7 @@ describe('The abstract stream', function() {
stream.addCursor("custom");
assert.exists(stream.getCursor("custom"));
stream.getCursor("custom").should.equal(0);
oc.close();
done();
});

Expand All @@ -56,6 +60,7 @@ describe('The abstract stream', function() {
stream.getCursor("base").should.equal(0);
stream.incrementCursor("base",10);
stream.getCursor("base").should.equal(10);
oc.close();
done();
});

Expand All @@ -66,6 +71,7 @@ describe('The abstract stream', function() {
stream.getCursor("base").should.equal(0);
stream.processContent("word");
stream.getCursor("base").should.equal(4);
oc.close();
done();
});

Expand All @@ -76,6 +82,7 @@ describe('The abstract stream', function() {
stream.getCursor("word").should.equal(0);
stream.processContent("word");
stream.getCursor("word").should.equal(0);
oc.close();
done();
});

Expand All @@ -91,6 +98,7 @@ describe('The abstract stream', function() {
stream.getCursor("base").should.equal(9);
stream.processContent(" and two more");
stream.getCursor("base").should.equal(22);
oc.close();
done();
});

Expand All @@ -106,6 +114,7 @@ describe('The abstract stream', function() {
stream.getCursor("word").should.equal(4);
stream.processContent(" and two more");
stream.getCursor("word").should.equal(18);
oc.close();
done();
});

Expand All @@ -121,6 +130,7 @@ describe('The abstract stream', function() {
stream.getCursor("word").should.equal(4);
stream.processContent(" and\n\n\ttwo more");
stream.getCursor("word").should.equal(21);
oc.close();
done();
});

Expand All @@ -131,6 +141,7 @@ describe('The abstract stream', function() {

stream.processContent("two\nwords");
stream.getBuffer().should.equal("words");
oc.close();
done();
});

Expand All @@ -142,6 +153,7 @@ describe('The abstract stream', function() {
stream.processContent("two\nwords");
stream.getCursor("word").should.equal(0);
stream.getCursor("base").should.equal(5);
oc.close();
done();
});

Expand Down

0 comments on commit d921b2c

Please sign in to comment.