Skip to content

Commit

Permalink
Merge pull request #302 from cosmos/fabo/fixed-tests
Browse files Browse the repository at this point in the history
Fabo/fixed tests
  • Loading branch information
jbibla authored Jan 2, 2018
2 parents 2fb3fa0 + a300229 commit b6b301c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"pack:main": "cross-env NODE_ENV=production webpack --colors --config webpack.main.config.js",
"pack:renderer": "cross-env NODE_ENV=production webpack --colors --config webpack.renderer.config.js",
"test": "npm run test:unit",
"test:unit": "cross-env LOGGING=false MOCK=false jest",
"test:unit": "cross-env LOGGING=false MOCK=false jest --maxWorkers=2",
"test:e2e": "tape \"test/e2e/!(main)*.js\"",
"vue:route": "node tasks/vue/route.js",
"vuex:module": "node tasks/vuex/module.js",
Expand Down
7 changes: 7 additions & 0 deletions test/unit/helpers/console_error_throw.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ if (!process.env.LISTENING_TO_UNHANDLED_REJECTION) {
process.env.LISTENING_TO_UNHANDLED_REJECTION = true
}

console.error = (...args) => {
throw new Error(args.join(' '))
}

console.warn = (...args) => {
throw new Error(args.join(' '))
}
2 changes: 1 addition & 1 deletion test/unit/helpers/genesis_mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let testRoot = './test/unit/tmp/test_root/'

function mockGenesis () {
process.env.COSMOS_HOME = testRoot
fs.ensureDirSync(testRoot)
fs.ensureFileSync(testRoot + 'genesis.json')
fs.writeFileSync(testRoot + 'genesis.json', JSON.stringify({
'genesis_time': '2017-12-12T02:31:37Z',
'chain_id': 'pure-test-net',
Expand Down
1 change: 1 addition & 0 deletions test/unit/specs/LiDelegate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe('LiDelegate', () => {
let test = instance.mount(LiDelegate, {
propsData: {
delegate: {
id: 'abc',
description: {}
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/unit/specs/Page404.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { mount } from 'vue-test-utils'
import setup from '../helpers/vuex-setup'
import Page404 from 'renderer/components/common/Page404'

describe('Page404', () => {
let instance = setup()
let wrapper

beforeEach(() => {
wrapper = mount(Page404, {
propsData: { }
})
let test = instance.mount(Page404)
wrapper = test.wrapper
})

it('has the expected html structure', () => {
Expand Down
14 changes: 7 additions & 7 deletions test/unit/specs/__snapshots__/Page404.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ exports[`Page404 has the expected html structure 1`] = `
<main
class="ni-part-main"
>
<router-link
class="ni-li ni-li-link"
to="/"
<a
class="ni-li ni-li-link router-link-exact-active router-link-active"
href="#/"
>
<div
class="ni-li-container"
Expand Down Expand Up @@ -104,10 +104,10 @@ exports[`Page404 has the expected html structure 1`] = `
</i>
</div>
</div>
</router-link>
<router-link
</a>
<a
class="ni-li ni-li-link"
to="/staking"
href="#/staking"
>
<div
class="ni-li-container"
Expand Down Expand Up @@ -146,7 +146,7 @@ exports[`Page404 has the expected html structure 1`] = `
</i>
</div>
</div>
</router-link>
</a>
</main>
</div>
</section>
Expand Down

0 comments on commit b6b301c

Please sign in to comment.