Skip to content

Commit cdce1e4

Browse files
lmiller1990AtofStryker
authored andcommitted
test: use spyOn
1 parent f29fbe5 commit cdce1e4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

test/specs/render.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describeDoNotRunIf(process.env.TEST_ENV !== 'node', 'render', () => {
88
template: '<div><h2>Test</h2><p></p><p></p></div>'
99
}
1010
const wrapper = await render(TestComponent)
11-
expect(wrapper).to.be.an.instanceof(Cheerio)
11+
expect(wrapper).toBeAnInstanceof(Cheerio)
1212
expect(wrapper.find('h2').text()).toEqual('Test')
1313
expect(wrapper.find('p').length).toEqual(2)
1414
})

test/specs/renderToString.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ describeDoNotRunIf(process.env.TEST_ENV !== 'node', 'renderToString', () => {
5959
$route
6060
}
6161
})
62-
expect(str).contains('true')
63-
expect(str).contains('http://test.com')
62+
expect(str).toContain('true')
63+
expect(str).toContain('http://test.com')
6464
})
6565

6666
it('mounts component with $parent set to options.parentComponent', async () => {

test/specs/wrapper.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ describeWithShallowAndMount('Wrapper', mountingMethod => {
2121
})
2222

2323
it('calls the hook function', () => {
24-
const hookSpy = sandbox.spy()
24+
const hookSpy = jest.fn()
2525

2626
enableAutoDestroy(hookSpy)
2727

28-
expect(hookSpy).calledOnce
28+
expect(hookSpy).toHaveBeenCalled()
2929
})
3030

3131
it('uses the hook function to destroy wrappers', () => {
@@ -34,11 +34,11 @@ describeWithShallowAndMount('Wrapper', mountingMethod => {
3434
hookCallback = callback
3535
})
3636
const wrapper = mountingMethod({ template: '<p>con tent</p>' })
37-
sandbox.spy(wrapper, 'destroy')
37+
jest.spyOn(wrapper, 'destroy')
3838

3939
hookCallback()
4040

41-
expect(wrapper.destroy).calledOnce
41+
expect(wrapper.destroy).toHaveBeenCalled()
4242
})
4343

4444
it('cannot be called twice', () => {

0 commit comments

Comments
 (0)