8
0
Pārlūkot izejas kodu

Fixed order of gulp update commands.

Oskar Wrobel 9 gadi atpakaļ
vecāks
revīzija
3b24b52d01
3 mainītis faili ar 20 papildinājumiem un 20 dzēšanām
  1. 3 3
      dev/tasks/dev/tasks/update.js
  2. 16 16
      dev/tests/dev/update.js
  3. 1 1
      package.json

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

@@ -48,12 +48,12 @@ module.exports = ( installTask, ckeditor5Path, packageJSON, workspaceRoot, runNp
 
 			// Check if repository's directory already exists.
 			if ( directories.indexOf( urlInfo.name ) > -1 ) {
-				log.out( `Checking out ${ urlInfo.name } to ${ urlInfo.branch }...` );
-				git.checkout( repositoryAbsolutePath, urlInfo.branch );
-
 				log.out( `Fetching branches from ${ urlInfo.name }...` );
 				git.fetchAll( repositoryAbsolutePath );
 
+				log.out( `Checking out ${ urlInfo.name } to ${ urlInfo.branch }...` );
+				git.checkout( repositoryAbsolutePath, urlInfo.branch );
+
 				log.out( `Pulling changes to ${ urlInfo.name }...` );
 				git.pull( repositoryAbsolutePath, urlInfo.branch );
 

+ 16 - 16
dev/tests/dev/update.js

@@ -52,16 +52,16 @@ describe( 'dev-update', () => {
 		const repoPath1 = path.join( workspaceAbsolutePath, dirs[ 0 ] );
 		const repoPath2 = path.join( workspaceAbsolutePath, dirs[ 1 ] );
 
+		sinon.assert.calledThrice( spies.fetchAll );
+		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
+		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
+		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
 		sinon.assert.calledTwice( spies.checkout );
 		sinon.assert.calledWithExactly( spies.checkout.firstCall, repoPath1, 'master' );
 		sinon.assert.calledWithExactly( spies.checkout.secondCall, repoPath2, 'new-branch' );
 		sinon.assert.calledTwice( spies.pull );
 		sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
 		sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
-		sinon.assert.calledThrice( spies.fetchAll );
-		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
-		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
-		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
 
 		sinon.assert.calledThrice( spies.npmUpdate );
 		sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
@@ -93,16 +93,16 @@ describe( 'dev-update', () => {
 		const repoPath1 = path.join( workspaceAbsolutePath, dirs[ 0 ] );
 		const repoPath2 = path.join( workspaceAbsolutePath, dirs[ 1 ] );
 
+		sinon.assert.calledThrice( spies.fetchAll );
+		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
+		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
+		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
 		sinon.assert.calledTwice( spies.checkout );
 		sinon.assert.calledWithExactly( spies.checkout.firstCall, repoPath1, 'master' );
 		sinon.assert.calledWithExactly( spies.checkout.secondCall, repoPath2, 'new-branch' );
 		sinon.assert.calledTwice( spies.pull );
 		sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
 		sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
-		sinon.assert.calledThrice( spies.fetchAll );
-		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
-		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
-		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
 
 		sinon.assert.calledThrice( spies.npmUpdate );
 		sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
@@ -135,16 +135,16 @@ describe( 'dev-update', () => {
 		const repoPath1 = path.join( workspaceAbsolutePath, dirs[ 0 ] );
 		const repoPath2 = path.join( workspaceAbsolutePath, dirs[ 1 ] );
 
+		sinon.assert.calledThrice( spies.fetchAll );
+		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
+		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
+		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
 		sinon.assert.calledTwice( spies.checkout );
 		sinon.assert.calledWithExactly( spies.checkout.firstCall, repoPath1, 'master' );
 		sinon.assert.calledWithExactly( spies.checkout.secondCall, repoPath2, 'new-branch' );
 		sinon.assert.calledTwice( spies.pull );
 		sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
 		sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
-		sinon.assert.calledThrice( spies.fetchAll );
-		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
-		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
-		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
 
 		sinon.assert.calledThrice( spies.npmUpdate );
 		sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
@@ -183,16 +183,16 @@ describe( 'dev-update', () => {
 		const repoPath1 = path.join( workspaceAbsolutePath, dirs[ 0 ] );
 		const repoPath2 = path.join( workspaceAbsolutePath, dirs[ 1 ] );
 
+		sinon.assert.calledThrice( spies.fetchAll );
+		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
+		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
+		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
 		sinon.assert.calledTwice( spies.checkout );
 		sinon.assert.calledWithExactly( spies.checkout.firstCall, repoPath1, 'master' );
 		sinon.assert.calledWithExactly( spies.checkout.secondCall, repoPath2, 'new-branch' );
 		sinon.assert.calledTwice( spies.pull );
 		sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
 		sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
-		sinon.assert.calledThrice( spies.fetchAll );
-		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
-		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
-		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
 
 		sinon.assert.notCalled( spies.npmUpdate );
 

+ 1 - 1
package.json

@@ -12,7 +12,7 @@
     "ckeditor5-theme-lark": "ckeditor/ckeditor5-theme-lark",
     "ckeditor5-ui": "ckeditor/ckeditor5-ui",
     "ckeditor5-ui-default": "ckeditor/ckeditor5-ui-default",
-    "ckeditor5-utils": "ckeditor/ckeditor5-utils",
+    "ckeditor5-utils": "ckeditor/ckeditor5-utils#t/testtest",
     "requirejs": "Reinmar/requirejs"
   },
   "devDependencies": {