|
| 1 | +'use strict' |
| 2 | + |
| 3 | +const check = createRuleChecker('vue-router/suppress-transition-error') |
| 4 | + |
| 5 | +describe('Rule: suppress-transition-error', () => { |
| 6 | + it('does not match an empty line', () => { |
| 7 | + const warning = check('') |
| 8 | + expect(warning).toBe(null) |
| 9 | + }) |
| 10 | + |
| 11 | + it('does not match "suppress transition error"', () => { |
| 12 | + const warning = check('suppress transition error') |
| 13 | + expect(warning).toBe(null) |
| 14 | + }) |
| 15 | + |
| 16 | + it('does not match "suppresstransitionerror"', () => { |
| 17 | + const warning = check('suppresstransitionerror') |
| 18 | + expect(warning).toBe(null) |
| 19 | + }) |
| 20 | + |
| 21 | + it('matches "suppressTransitionError"', () => { |
| 22 | + const warning = check('suppressTransitionError') |
| 23 | + expect(warning).toBeTruthy() |
| 24 | + expect(warning.fix).toBe('Remove the suppressTransitionError option') |
| 25 | + }) |
| 26 | + |
| 27 | + it('matches "suppressTransitionError:"', () => { |
| 28 | + const warning = check(` |
| 29 | + suppressTransitionError: |
| 30 | + `) |
| 31 | + expect(warning).toBeTruthy() |
| 32 | + expect(warning.fix).toBe('Remove the suppressTransitionError option') |
| 33 | + }) |
| 34 | + |
| 35 | + it('matches "suppressTransitionError :"', () => { |
| 36 | + const warning = check(` |
| 37 | + suppressTransitionError : |
| 38 | + `) |
| 39 | + expect(warning).toBeTruthy() |
| 40 | + expect(warning.fix).toBe('Remove the suppressTransitionError option') |
| 41 | + }) |
| 42 | +}) |
0 commit comments