8
0
Просмотр исходного кода

Updated in-node tests.

Changed `ckeditor5-dev-utils` submodule name from `build` to `stream`.
Maksymilian Barnaś 9 лет назад
Родитель
Сommit
e99ab32b4a
2 измененных файлов с 16 добавлено и 16 удалено
  1. 3 3
      dev/tasks/test/tasks.js
  2. 13 13
      dev/tests/test/tasks.js

+ 3 - 3
dev/tasks/test/tasks.js

@@ -11,7 +11,7 @@ const filterBy = require( 'gulp-filter-by' );
 const filter = require( 'gulp-filter' );
 const sinon = require( 'sinon' );
 const semver = require( 'semver' );
-const { tools, build } = require( 'ckeditor5-dev-utils' );
+const { tools, stream } = require( 'ckeditor5-dev-utils' );
 const benderConfig = require( '../../../bender' );
 
 /**
@@ -100,7 +100,7 @@ module.exports = () => {
 				.pipe( tasks.skipManual() )
 				.pipe( tasks.skipIgnored() )
 				.pipe( mocha( { reporter: 'progress' } ) )
-				.pipe( tasks.coverage ? istanbul.writeReports() : build.noop() );
+				.pipe( tasks.coverage ? istanbul.writeReports() : stream.noop() );
 		},
 
 		/**
@@ -132,7 +132,7 @@ module.exports = () => {
 		devTest() {
 			return gulp.src( 'dev/tests/**/*.js' )
 				.pipe( mocha() )
-				.pipe( tasks.coverage ? istanbul.writeReports() : build.noop() );
+				.pipe( tasks.coverage ? istanbul.writeReports() : stream.noop() );
 		},
 
 		/**

+ 13 - 13
dev/tests/test/tasks.js

@@ -9,12 +9,12 @@
 
 const Vinyl = require( 'vinyl' );
 const tasks = require( '../../tasks/test/tasks' )();
-const { build, tools } = require( 'ckeditor5-dev-utils' );
+const { stream, tools } = require( 'ckeditor5-dev-utils' );
 
 describe( 'test-node', () => {
 	describe( 'skipManual', () => {
 		it( 'should skip manual tests', ( done ) => {
-			const stream = tasks.skipManual();
+			const streamTask = tasks.skipManual();
 			const spy = sinon.spy();
 			const stub = sinon.stub( tools, 'isFile', ( file ) => {
 				return file == 'file1.md';
@@ -30,25 +30,25 @@ describe( 'test-node', () => {
 				contents: null
 			} );
 
-			stream.pipe( build.noop( spy ) );
+			streamTask.pipe( stream.noop( spy ) );
 
-			stream.once( 'finish', () => {
+			streamTask.once( 'finish', () => {
 				sinon.assert.calledOnce( spy );
 				sinon.assert.calledWithExactly( spy, unitTestFile );
 				done();
 			} );
 
-			stream.write( manualTestFile );
-			stream.write( unitTestFile );
+			streamTask.write( manualTestFile );
+			streamTask.write( unitTestFile );
 
-			stream.end();
+			streamTask.end();
 			stub.restore();
 		} );
 	} );
 
 	describe( 'skipIgnored', () => {
 		it( 'should skip files marked to ignore', ( done ) => {
-			const stream = tasks.skipIgnored();
+			const streamTask = tasks.skipIgnored();
 			const spy = sinon.spy();
 			const unitTestFile = new Vinyl( {
 				cwd: './',
@@ -60,18 +60,18 @@ describe( 'test-node', () => {
 				path: 'file1.js',
 				contents: new Buffer( '/* bender-tags: tag, browser-only */' )
 			} );
-			const noop = build.noop( spy );
+			const noop = stream.noop( spy );
 			noop.once( 'finish', () => {
 				sinon.assert.calledOnce( spy );
 				sinon.assert.calledWithExactly( spy, unitTestFile );
 				done();
 			} );
 
-			stream.pipe( noop );
-			stream.write( manualTestFile );
-			stream.write( unitTestFile );
+			streamTask.pipe( noop );
+			streamTask.write( manualTestFile );
+			streamTask.write( unitTestFile );
 
-			stream.end();
+			streamTask.end();
 		} );
 	} );
 } );