Skip to content

Commit

Permalink
Merge pull request #1348 from LiskHQ/1302-fix-jenkins-jest
Browse files Browse the repository at this point in the history
Fix jest tests to pass in Jenkins - Closes #1302
  • Loading branch information
bmaggi-lisk authored Oct 15, 2018
2 parents ec56c39 + 77eccd4 commit 27fb0ff
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
12 changes: 5 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ pipeline {
},
"jest": {
ansiColor('xterm') {
// TODO: fail on errors when jest test suite is ready
// see https://github.com/LiskHQ/lisk-hub/issues/1302
sh 'ON_JENKINS=true npm run --silent test-jest || true'

sh 'ON_JENKINS=true npm run --silent test-jest'

// TODO: uncomment sending coverage to coveralls when
// all tests are migrated from mocha to jest
// withCredentials([string(credentialsId: 'lisk-hub-coveralls-token', variable: 'COVERALLS_REPO_TOKEN')]) {
// sh 'cat coverage/HeadlessChrome*/lcov.info |coveralls -v'
// }
// withCredentials([string(credentialsId: 'lisk-hub-coveralls-token', variable: 'COVERALLS_REPO_TOKEN')]) {
// sh 'cat coverage/HeadlessChrome*/lcov.info |coveralls -v'
// }
}
},
"cypress": {
Expand Down
2 changes: 2 additions & 0 deletions config/setupJest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import sinon from 'sinon';
import sinonStubPromise from 'sinon-stub-promise';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import i18next from 'i18next';

require('jest-localstorage-mock');

Expand All @@ -18,3 +19,4 @@ chai.use(chaiAsPromised);
sinonStubPromise(sinon);
// eslint-disable-next-line no-undef
jest.useFakeTimers();
i18next.t = key => key;
1 change: 1 addition & 0 deletions i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@
"Transaction": "Transaction",
"Transaction ID": "Transaction ID",
"Transaction is being processed and will be confirmed. It may take up to 15 minutes to be secured in the blockchain.": "Transaction is being processed and will be confirmed. It may take up to 15 minutes to be secured in the blockchain.",
"Transaction not found": "Transaction not found",
"Transactions can’t be reversed": "Transactions can’t be reversed",
"Transfer": "Transfer",
"Try again": "Try again",
Expand Down
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ module.exports = {
],
coverageThreshold: {
global: {
branches: 79,
functions: 80,
lines: 80,
statements: 80,
branches: 10,
functions: 10,
lines: 10,
statements: 10,
},
},
setupFiles: [
Expand Down
2 changes: 1 addition & 1 deletion src/actions/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const loadTransaction = ({ id }) =>
let deleted = [];

if (!response.data.length) {
dispatch({ data: { error: 'Transaction not found' }, type: actionTypes.transactionLoadFailed });
dispatch({ data: { error: i18next.t('Transaction not found') }, type: actionTypes.transactionLoadFailed });
return;
}

Expand Down

0 comments on commit 27fb0ff

Please sign in to comment.