Skip to content

Commit

Permalink
fix test log missing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wxsms committed Nov 16, 2017
1 parent eb12797 commit b9db3db
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions test/unit/specs/MessageBox.spec.js
Expand Up @@ -10,30 +10,23 @@ describe('MessageBox', () => {
let spy
let savedLog

before(() => {
beforeEach(() => {
savedLog = console.log
console.log = function () {
return true
}
})

after(() => {
console.log = savedLog
// console.log(123)
})

beforeEach(() => {
const Constructor = Vue.extend(MessageBoxDoc)
vm = new Constructor().$mount()
$el = $(vm.$el)
spy = sinon.spy(console, 'log')
})

afterEach(() => {
console.log.restore()
console.log = savedLog
vm.$destroy()
$el.remove()
$('.modal-backdrop, .modal').remove()
console.log.restore()
})

it('should be able to open alert box', async () => {
Expand Down

0 comments on commit b9db3db

Please sign in to comment.