コード例 #1
0
ファイル: user.test.js プロジェクト: sudodoki/api_client_test
 afterEach(function() {
   if (fs.createWriteStream.restore) {
     fs.createWriteStream.restore();
   }
   if (fs.createReadStream.restore) {
     fs.createReadStream.restore();
   }
 });
コード例 #2
0
ファイル: index.test.js プロジェクト: Gaubee/gulp-spawn-mocha
 it('can output to a writable stream from a string argument', function () {
   var fakeStream = {};
   sinon.stub(fs, 'createWriteStream').returns(fakeStream);
   var stream = this.stream = mocha({output: 'result.log'});
   stream.end();
   fs.createWriteStream.should.be.calledWith('result.log');
   fs.createWriteStream.restore();
   this.childOut.pipe.should.be.calledWith(fakeStream);
   this.childErr.pipe.should.be.calledWith(fakeStream);
 });
コード例 #3
0
 afterEach(function() {
   http.get.restore();
   fs.createWriteStream.restore();
 });