|
| 1 | +import {render} from '..' |
| 2 | + |
| 3 | +beforeEach(() => { |
| 4 | + jest.spyOn(console, 'warn').mockImplementation(() => {}) |
| 5 | +}) |
| 6 | + |
| 7 | +afterEach(() => { |
| 8 | + console.warn.mockRestore() |
| 9 | +}) |
| 10 | + |
| 11 | +test('warns on deprecated store option', () => { |
| 12 | + const Component = {template: `<div></div>`} |
| 13 | + |
| 14 | + render(Component, { |
| 15 | + store: 'anything', |
| 16 | + }) |
| 17 | + |
| 18 | + expect(console.warn).toHaveBeenCalledTimes(1) |
| 19 | + expect(console.warn).toHaveBeenCalledWith( |
| 20 | + expect.stringContaining( |
| 21 | + `Providing 'store' or 'routes' options is now deprecated`, |
| 22 | + ), |
| 23 | + ) |
| 24 | +}) |
| 25 | + |
| 26 | +test('warns on deprecated routes option', () => { |
| 27 | + const Component = {template: `<div></div>`} |
| 28 | + |
| 29 | + render(Component, { |
| 30 | + routes: 'anything', |
| 31 | + }) |
| 32 | + |
| 33 | + expect(console.warn).toHaveBeenCalledTimes(1) |
| 34 | + expect(console.warn).toHaveBeenCalledWith( |
| 35 | + expect.stringContaining( |
| 36 | + `Providing 'store' or 'routes' options is now deprecated`, |
| 37 | + ), |
| 38 | + ) |
| 39 | +}) |
0 commit comments