Skip to content

Commit

Permalink
Fixed failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pomek committed Dec 20, 2022
1 parent 731dc16 commit 0d6a1df
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe( 'lib/tasks/translations-download', () => {
} );

it( 'downloads translation files', async () => {
stubs.getToken.resolves( 'secretToken' );
stubs.transifex.getToken.resolves( 'secretToken' );
stubs.transifex.downloadTranslations.resolves( 'OK' );

const results = await translationsDownload( {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe( 'lib/tasks/translations-upload', () => {
} );

it( 'uploads translation files', async () => {
stubs.getToken.resolves( 'secretToken' );
stubs.transifex.getToken.resolves( 'secretToken' );
stubs.transifex.uploadPotFiles.resolves( 'OK' );

const results = await translationsUpload( {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ describe( 'lib/utils/get-webpack-config-dll', () => {
webpack: sinon.stub(),
dllReferencePlugin: sinon.stub(),
providePlugin: sinon.stub(),
devWebpackPlugin: sinon.stub(),
devTranslations: {
CKEditorTranslationsPlugin: sinon.stub()
},
webpackUtils: {
loaderDefinitions: {
raw: sinon.stub(),
Expand Down Expand Up @@ -70,7 +72,7 @@ describe( 'lib/utils/get-webpack-config-dll', () => {
mockery.registerMock( 'path', stubs.path );
mockery.registerMock( 'webpack', stubs.webpack );
mockery.registerMock( './webpack-utils', stubs.webpackUtils );
mockery.registerMock( '@ckeditor/ckeditor5-dev-webpack-plugin', stubs.devWebpackPlugin );
mockery.registerMock( '@ckeditor/ckeditor5-dev-translations', stubs.devTranslations );

mockery.registerMock( '/process/cwd/node_modules/ckeditor5/build/ckeditor5-dll.manifest.json', stubs.ckeditor5manifest );
mockery.registerMock( '/process/cwd/package.json', stubs.packageJson );
Expand Down Expand Up @@ -163,8 +165,8 @@ describe( 'lib/utils/get-webpack-config-dll', () => {
expect( stubs.fs.existsSync.calledOnce ).to.equal( true );
expect( stubs.fs.existsSync.firstCall.firstArg ).to.equal( '/process/cwd/lang/translations/en.po' );

expect( stubs.devWebpackPlugin.calledOnce ).to.equal( true );
expect( stubs.devWebpackPlugin.firstCall.firstArg ).to.deep.equal( {
expect( stubs.devTranslations.CKEditorTranslationsPlugin.calledOnce ).to.equal( true );
expect( stubs.devTranslations.CKEditorTranslationsPlugin.firstCall.firstArg ).to.deep.equal( {
additionalLanguages: 'all',
language: 'en',
skipPluralFormFunction: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ describe( 'lib/utils/get-webpack-config-server', () => {
webpack: sinon.stub(),
providePlugin: sinon.stub(),
definePlugin: sinon.stub(),
devWebpackPlugin: sinon.stub(),
devTranslations: {
CKEditorTranslationsPlugin: sinon.stub()
},
webpackUtils: {
loaderDefinitions: {
raw: sinon.stub(),
Expand Down Expand Up @@ -67,7 +69,7 @@ describe( 'lib/utils/get-webpack-config-server', () => {
mockery.registerMock( 'path', stubs.path );
mockery.registerMock( 'webpack', stubs.webpack );
mockery.registerMock( './webpack-utils', stubs.webpackUtils );
mockery.registerMock( '@ckeditor/ckeditor5-dev-webpack-plugin', stubs.devWebpackPlugin );
mockery.registerMock( '@ckeditor/ckeditor5-dev-translations', stubs.devTranslations );

getWebpackConfigServer = require( '../../lib/utils/get-webpack-config-server' );
} );
Expand Down Expand Up @@ -181,8 +183,8 @@ describe( 'lib/utils/get-webpack-config-server', () => {
EDITOR_LANGUAGE: '"pl"'
} );

expect( stubs.devWebpackPlugin.calledOnce ).to.equal( true );
expect( stubs.devWebpackPlugin.firstCall.firstArg ).to.deep.equal( {
expect( stubs.devTranslations.CKEditorTranslationsPlugin.calledOnce ).to.equal( true );
expect( stubs.devTranslations.CKEditorTranslationsPlugin.firstCall.firstArg ).to.deep.equal( {
language: 'pl',
sourceFilesPattern: /src[/\\].+\.[jt]s$/
} );
Expand Down

0 comments on commit 0d6a1df

Please sign in to comment.