|
1 |
| -const parser = require('../main'); |
| 1 | +const parser = require("../main"); |
2 | 2 |
|
3 |
| -describe('continue', () => { |
4 |
| - it('simple', () => { |
5 |
| - expect(parser.parseEval('continue;')).toMatchSnapshot(); |
| 3 | +describe("continue", () => { |
| 4 | + it("simple", () => { |
| 5 | + expect(parser.parseEval("continue;")).toMatchSnapshot(); |
6 | 6 | });
|
7 |
| - it('argument 0', () => { |
8 |
| - expect(parser.parseEval('continue 0;')).toMatchSnapshot(); |
| 7 | + it("argument 0", () => { |
| 8 | + expect(parser.parseEval("continue 0;")).toMatchSnapshot(); |
9 | 9 | });
|
10 |
| - it('argument 1', () => { |
11 |
| - expect(parser.parseEval('continue 1;')).toMatchSnapshot(); |
| 10 | + it("argument 1", () => { |
| 11 | + expect(parser.parseEval("continue 1;")).toMatchSnapshot(); |
12 | 12 | });
|
13 |
| - it('argument 2', () => { |
14 |
| - expect(parser.parseEval('continue 2;')).toMatchSnapshot(); |
| 13 | + it("argument 2", () => { |
| 14 | + expect(parser.parseEval("continue 2;")).toMatchSnapshot(); |
15 | 15 | });
|
16 |
| - it('with parens', () => { |
17 |
| - expect(parser.parseEval('continue (1);')).toMatchSnapshot(); |
| 16 | + it("with parens", () => { |
| 17 | + expect(parser.parseEval("continue (1);")).toMatchSnapshot(); |
18 | 18 | });
|
19 | 19 | // Deprecated since 5.4.0
|
20 |
| - it('with expression', () => { |
21 |
| - expect(parser.parseEval('continue $var;')).toMatchSnapshot(); |
| 20 | + it("with expression", () => { |
| 21 | + expect(parser.parseEval("continue $var;")).toMatchSnapshot(); |
| 22 | + }); |
| 23 | + it("should fail when no ';' at end", function() { |
| 24 | + expect( |
| 25 | + parser.parseEval("continue", { |
| 26 | + parser: { suppressErrors: true } |
| 27 | + }) |
| 28 | + ).toMatchSnapshot(); |
22 | 29 | });
|
23 | 30 | });
|
0 commit comments