Skip to content

Commit

Permalink
fix: name of test file and expect.js
Browse files Browse the repository at this point in the history
  • Loading branch information
schnittstabil committed Jul 5, 2014
1 parent 34b47a8 commit f0a4181
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
3 changes: 0 additions & 3 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"globals": {
/* expect.js */
"expect": true,

/* mocha */
"after": true,
"afterEach": true,
Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ gulp.task('lint', function() {
});

gulp.task('coverage', function (done) {
gulp.src(scripts.concat(['!test/**']))
gulp.src(scripts.concat(['!test.js']))
.pipe(istanbul())
.on('finish', function () {
/* tests */
gulp.src(['test/**/*.js'])
gulp.src(['test.js'])
.pipe(mocha({
reporter: 'dot',
timeout: 100000
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stream-recorder",
"version": "0.2.0",
"version": "0.2.1",
"description": "A Duplex stream which collects all chunks passed through",
"main": "index.js",
"scripts": {
Expand All @@ -12,6 +12,7 @@
},
"keywords": [
"passthrough",
"duplex",
"stream",
"record",
"collect",
Expand All @@ -31,7 +32,6 @@
],
"devDependencies": {
"coveralls": "^2.11.0",
"expect.js": "^0.3.1",
"gulp": "^3.8.5",
"gulp-istanbul": "^0.2.0",
"gulp-jscs": "^0.6.0",
Expand Down
17 changes: 8 additions & 9 deletions test/string_test.js → test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
var Recorder = require('../index'),
expect = require('expect.js'),
var Recorder = require('./index'),
assert = require('assert'),
gulp = require('gulp');

function Getter(name) {
Expand All @@ -19,7 +19,7 @@ describe('String streams', function() {
}, sut);
sut.end();
sut.resume();
expect(sut.data.toString()).to.be(input.join(''));
assert.strictEqual(sut.data.toString(), input.join(''));
});

it('should be recorded with decodeStrings:false option', function() {
Expand All @@ -29,7 +29,7 @@ describe('String streams', function() {
}, sut);
sut.end();
sut.resume();
expect(sut.data.toString()).to.be(input.join(''));
assert.strictEqual(sut.data.toString(), input.join(''));
});
});

Expand All @@ -42,7 +42,7 @@ describe('String object streams', function() {
}, sut);
sut.end();
sut.resume();
expect(sut.data).to.eql(input);
assert.deepEqual(sut.data, input);
});
});

Expand All @@ -57,7 +57,7 @@ describe('Mixed object streams', function() {
}, sut);
sut.end();
sut.resume();
expect(sut.data).to.eql(input);
assert.deepEqual(sut.data, input);
});
});

Expand All @@ -68,8 +68,7 @@ describe('Gulp streams', function() {
.pipe(sut)
.on('error', done)
.on('finish', function() {
expect(sut.data.map(new Getter('path'))).to.eql([__filename]);
expect(sut.data.length).to.be(1);
assert.deepEqual(sut.data.map(new Getter('path')), [__filename]);
done();
});
});
Expand All @@ -79,6 +78,6 @@ describe('StreamRecorder constructor', function() {
it('should return new instance w/o new', function() {
var sut = Recorder,
instance = sut();
expect(instance).to.be.a(Recorder);
assert.strictEqual(instance instanceof Recorder, true);
});
});

0 comments on commit f0a4181

Please sign in to comment.