-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathdeprecated-options.js
More file actions
39 lines (31 loc) · 869 Bytes
/
deprecated-options.js
File metadata and controls
39 lines (31 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import {render} from '..'
beforeEach(() => {
jest.spyOn(console, 'warn').mockImplementation(() => {})
})
afterEach(() => {
console.warn.mockRestore()
})
test('warns on deprecated store option', () => {
const Component = {template: `<div></div>`}
render(Component, {
store: 'anything',
})
expect(console.warn).toHaveBeenCalledTimes(1)
expect(console.warn).toHaveBeenCalledWith(
expect.stringContaining(
`Providing 'store' or 'routes' options is no longer available`,
),
)
})
test('warns on deprecated routes option', () => {
const Component = {template: `<div></div>`}
render(Component, {
routes: 'anything',
})
expect(console.warn).toHaveBeenCalledTimes(1)
expect(console.warn).toHaveBeenCalledWith(
expect.stringContaining(
`Providing 'store' or 'routes' options is no longer available`,
),
)
})