|
|
@@ -24,7 +24,7 @@ describe( 'dev-update', () => {
|
|
|
const spies = {};
|
|
|
|
|
|
beforeEach( () => {
|
|
|
- spies.getDependencies = sinon.spy( ckeditor5Dirs, 'getCKEditorDependencies' );
|
|
|
+ spies.getDependencies = sinon.spy( ckeditor5Dirs, 'getDependencies' );
|
|
|
spies.checkout = sinon.stub( git, 'checkout' );
|
|
|
spies.pull = sinon.stub( git, 'pull' );
|
|
|
spies.fetchAll = sinon.stub( git, 'fetchAll' );
|
|
|
@@ -40,8 +40,8 @@ describe( 'dev-update', () => {
|
|
|
it( 'should update dev repositories', () => {
|
|
|
const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
|
|
|
const installTask = sinon.spy();
|
|
|
- spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getCKE5Directories' ).returns( dirs );
|
|
|
- spies.getCKE5Symlinks = sinon.stub( ckeditor5Dirs, 'getCKE5Symlinks' ).returns( [] );
|
|
|
+ spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getDirectories' ).returns( dirs );
|
|
|
+ spies.getSymlinks = sinon.stub( ckeditor5Dirs, 'getSymlinks' ).returns( [] );
|
|
|
|
|
|
const json = {
|
|
|
dependencies: {
|
|
|
@@ -72,7 +72,7 @@ describe( 'dev-update', () => {
|
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.secondCall, path.join( workspaceAbsolutePath, dirs[ 1 ] ) );
|
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.thirdCall, ckeditor5Path );
|
|
|
|
|
|
- sinon.assert.calledOnce( spies.getCKE5Symlinks );
|
|
|
+ sinon.assert.calledOnce( spies.getSymlinks );
|
|
|
sinon.assert.notCalled( spies.removeSymlink );
|
|
|
sinon.assert.notCalled( installTask );
|
|
|
} );
|
|
|
@@ -80,8 +80,8 @@ describe( 'dev-update', () => {
|
|
|
it( 'should install missing dependencies', () => {
|
|
|
const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
|
|
|
const installTask = sinon.spy();
|
|
|
- spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getCKE5Directories' ).returns( dirs );
|
|
|
- spies.getCKE5Symlinks = sinon.stub( ckeditor5Dirs, 'getCKE5Symlinks' ).returns( [] );
|
|
|
+ spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getDirectories' ).returns( dirs );
|
|
|
+ spies.getSymlinks = sinon.stub( ckeditor5Dirs, 'getSymlinks' ).returns( [] );
|
|
|
|
|
|
const json = {
|
|
|
dependencies: {
|
|
|
@@ -116,15 +116,15 @@ describe( 'dev-update', () => {
|
|
|
sinon.assert.calledOnce( installTask );
|
|
|
sinon.assert.calledWithExactly( installTask, ckeditor5Path, workspaceRoot, 'ckeditor/ckeditor5-ui' );
|
|
|
|
|
|
- sinon.assert.calledOnce( spies.getCKE5Symlinks );
|
|
|
+ sinon.assert.calledOnce( spies.getSymlinks );
|
|
|
sinon.assert.notCalled( spies.removeSymlink );
|
|
|
} );
|
|
|
|
|
|
it( 'should remove symlinks that are not needed', () => {
|
|
|
const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
|
|
|
const installTask = sinon.spy();
|
|
|
- spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getCKE5Directories' ).returns( dirs );
|
|
|
- spies.getCKE5Symlinks = sinon.stub( ckeditor5Dirs, 'getCKE5Symlinks' ).returns( [ 'ckeditor5-unused' ] );
|
|
|
+ spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getDirectories' ).returns( dirs );
|
|
|
+ spies.getSymlinks = sinon.stub( ckeditor5Dirs, 'getSymlinks' ).returns( [ 'ckeditor5-unused' ] );
|
|
|
|
|
|
const json = {
|
|
|
dependencies: {
|
|
|
@@ -155,7 +155,7 @@ describe( 'dev-update', () => {
|
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.secondCall, path.join( workspaceAbsolutePath, dirs[ 1 ] ) );
|
|
|
sinon.assert.calledWithExactly( spies.npmUpdate.thirdCall, ckeditor5Path );
|
|
|
|
|
|
- sinon.assert.calledOnce( spies.getCKE5Symlinks );
|
|
|
+ sinon.assert.calledOnce( spies.getSymlinks );
|
|
|
sinon.assert.notCalled( installTask );
|
|
|
|
|
|
sinon.assert.calledOnce( spies.removeSymlink );
|
|
|
@@ -168,8 +168,8 @@ describe( 'dev-update', () => {
|
|
|
const installTask = sinon.spy();
|
|
|
const outSpy = sinon.spy();
|
|
|
const errSpy = sinon.spy();
|
|
|
- spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getCKE5Directories' ).returns( dirs );
|
|
|
- spies.getCKE5Symlinks = sinon.stub( ckeditor5Dirs, 'getCKE5Symlinks' ).returns( [ 'ckeditor5-unused' ] );
|
|
|
+ spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getDirectories' ).returns( dirs );
|
|
|
+ spies.getSymlinks = sinon.stub( ckeditor5Dirs, 'getSymlinks' ).returns( [ 'ckeditor5-unused' ] );
|
|
|
spies.linkDirectories.throws();
|
|
|
|
|
|
log.configure( outSpy, errSpy );
|
|
|
@@ -200,7 +200,7 @@ describe( 'dev-update', () => {
|
|
|
|
|
|
sinon.assert.notCalled( spies.npmUpdate );
|
|
|
|
|
|
- sinon.assert.calledOnce( spies.getCKE5Symlinks );
|
|
|
+ sinon.assert.calledOnce( spies.getSymlinks );
|
|
|
sinon.assert.notCalled( installTask );
|
|
|
|
|
|
sinon.assert.calledOnce( spies.removeSymlink );
|
|
|
@@ -210,11 +210,11 @@ describe( 'dev-update', () => {
|
|
|
|
|
|
it( 'should skip updating if no dependencies found and fetch only main repository', () => {
|
|
|
spies.getDependencies.restore();
|
|
|
- spies.getDependencies = sinon.stub( ckeditor5Dirs, 'getCKEditorDependencies' ).returns( null );
|
|
|
+ spies.getDependencies = sinon.stub( ckeditor5Dirs, 'getDependencies' ).returns( null );
|
|
|
const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
|
|
|
const installTask = sinon.spy();
|
|
|
- spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getCKE5Directories' ).returns( dirs );
|
|
|
- spies.getCKE5Symlinks = sinon.stub( ckeditor5Dirs, 'getCKE5Symlinks' ).returns( [] );
|
|
|
+ spies.getDirectories = sinon.stub( ckeditor5Dirs, 'getDirectories' ).returns( dirs );
|
|
|
+ spies.getSymlinks = sinon.stub( ckeditor5Dirs, 'getSymlinks' ).returns( [] );
|
|
|
|
|
|
const json = {
|
|
|
dependencies: {
|
|
|
@@ -234,7 +234,7 @@ describe( 'dev-update', () => {
|
|
|
|
|
|
sinon.assert.notCalled( spies.npmUpdate );
|
|
|
|
|
|
- sinon.assert.calledOnce( spies.getCKE5Symlinks );
|
|
|
+ sinon.assert.calledOnce( spies.getSymlinks );
|
|
|
sinon.assert.notCalled( installTask );
|
|
|
|
|
|
sinon.assert.notCalled( spies.removeSymlink );
|