|
@@ -23,6 +23,7 @@ describe( 'dev-update', () => {
|
|
|
spies.getDependencies = sinon.spy( tools, 'getCKEditorDependencies' );
|
|
spies.getDependencies = sinon.spy( tools, 'getCKEditorDependencies' );
|
|
|
spies.checkout = sinon.stub( git, 'checkout' );
|
|
spies.checkout = sinon.stub( git, 'checkout' );
|
|
|
spies.pull = sinon.stub( git, 'pull' );
|
|
spies.pull = sinon.stub( git, 'pull' );
|
|
|
|
|
+ spies.fetchAll = sinon.stub( git, 'fetchAll' );
|
|
|
spies.npmUpdate = sinon.stub( tools, 'npmUpdate' );
|
|
spies.npmUpdate = sinon.stub( tools, 'npmUpdate' );
|
|
|
spies.linkDirectories = sinon.stub( tools, 'linkDirectories' );
|
|
spies.linkDirectories = sinon.stub( tools, 'linkDirectories' );
|
|
|
spies.removeSymlink = sinon.stub( tools, 'removeSymlink' );
|
|
spies.removeSymlink = sinon.stub( tools, 'removeSymlink' );
|
|
@@ -57,6 +58,10 @@ describe( 'dev-update', () => {
|
|
|
sinon.assert.calledTwice( spies.pull );
|
|
sinon.assert.calledTwice( spies.pull );
|
|
|
sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
|
|
sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
|
|
|
sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
|
|
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.calledThrice( spies.npmUpdate );
|
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
|
|
@@ -94,6 +99,10 @@ describe( 'dev-update', () => {
|
|
|
sinon.assert.calledTwice( spies.pull );
|
|
sinon.assert.calledTwice( spies.pull );
|
|
|
sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
|
|
sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
|
|
|
sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
|
|
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.calledThrice( spies.npmUpdate );
|
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
|
|
@@ -132,6 +141,10 @@ describe( 'dev-update', () => {
|
|
|
sinon.assert.calledTwice( spies.pull );
|
|
sinon.assert.calledTwice( spies.pull );
|
|
|
sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
|
|
sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
|
|
|
sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
|
|
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.calledThrice( spies.npmUpdate );
|
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
|
|
@@ -176,6 +189,10 @@ describe( 'dev-update', () => {
|
|
|
sinon.assert.calledTwice( spies.pull );
|
|
sinon.assert.calledTwice( spies.pull );
|
|
|
sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
|
|
sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
|
|
|
sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
|
|
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 );
|
|
sinon.assert.notCalled( spies.npmUpdate );
|
|
|
|
|
|
|
@@ -187,7 +204,7 @@ describe( 'dev-update', () => {
|
|
|
sinon.assert.calledTwice( errSpy );
|
|
sinon.assert.calledTwice( errSpy );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- it( 'should skip updating if no dependencies found', () => {
|
|
|
|
|
|
|
+ it( 'should skip updating if no dependencies found and fetch only main repository', () => {
|
|
|
spies.getDependencies.restore();
|
|
spies.getDependencies.restore();
|
|
|
spies.getDependencies = sinon.stub( tools, 'getCKEditorDependencies' ).returns( null );
|
|
spies.getDependencies = sinon.stub( tools, 'getCKEditorDependencies' ).returns( null );
|
|
|
const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
|
|
const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
|
|
@@ -205,6 +222,9 @@ describe( 'dev-update', () => {
|
|
|
|
|
|
|
|
updateTask( installTask, ckeditor5Path, json, workspaceRoot, false );
|
|
updateTask( installTask, ckeditor5Path, json, workspaceRoot, false );
|
|
|
|
|
|
|
|
|
|
+ sinon.assert.calledOnce( spies.fetchAll );
|
|
|
|
|
+ sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
|
|
|
|
|
+
|
|
|
sinon.assert.notCalled( spies.checkout );
|
|
sinon.assert.notCalled( spies.checkout );
|
|
|
sinon.assert.notCalled( spies.pull );
|
|
sinon.assert.notCalled( spies.pull );
|
|
|
|
|
|