|
1 | 1 | import {throws} from './util/helpers';
|
2 | 2 |
|
3 | 3 | // Unclosed elements
|
4 |
| -throws('unclosed string', 'a[href="wow]'); |
5 |
| -throws('unclosed comment', '/* oops'); |
6 |
| -throws('unclosed pseudo element', 'button::'); |
7 |
| -throws('unclosed pseudo class', 'a:'); |
| 4 | +throws('unclosed string', 'a[href="wow]', 'Unclosed quote'); |
| 5 | +throws('unclosed comment', '/* oops', 'Unclosed comment'); |
| 6 | +throws('unclosed pseudo element', 'button::', 'Expected a pseudo-class or pseudo-element.'); |
| 7 | +throws('unclosed pseudo class', 'a:', 'Expected a pseudo-class or pseudo-element.'); |
8 | 8 | throws('unclosed attribute selector', '[name="james"][href');
|
9 | 9 |
|
10 |
| -throws('no opening parenthesis', ')'); |
11 |
| -throws('no opening parenthesis (2)', ':global.foo)'); |
12 |
| -throws('no opening parenthesis (3)', 'h1:not(h2:not(h3)))'); |
| 10 | +throws('no opening parenthesis', ')', 'Expected an opening parenthesis.'); |
| 11 | +throws('no opening parenthesis (2)', ':global.foo)', 'Expected an opening parenthesis.'); |
| 12 | +throws('no opening parenthesis (3)', 'h1:not(h2:not(h3)))', 'Expected an opening parenthesis.'); |
13 | 13 |
|
14 |
| -throws('no opening square bracket', ']'); |
15 |
| -throws('no opening square bracket (2)', ':global.foo]'); |
16 |
| -throws('no opening square bracket (3)', '[global]]'); |
| 14 | +throws('no opening square bracket', ']', 'Expected an opening square bracket.'); |
| 15 | +throws('no opening square bracket (2)', ':global.foo]', 'Expected an opening square bracket.'); |
| 16 | +throws('no opening square bracket (3)', '[global]]', 'Expected an opening square bracket.'); |
17 | 17 |
|
18 |
| -throws('bad pseudo element', 'button::"after"'); |
19 |
| -throws('missing closing parenthesis in pseudo', ':not([attr="test"]:not([attr="test"])'); |
| 18 | +throws('bad pseudo element', 'button::"after"', 'Expected a pseudo-class or pseudo-element.'); |
| 19 | +throws('missing closing parenthesis in pseudo', ':not([attr="test"]:not([attr="test"])', 'Expected a closing parenthesis.'); |
20 | 20 |
|
21 |
| -throws('bad syntax', '-moz-osx-font-smoothing: grayscale'); |
22 |
| -throws('bad syntax (2)', '! .body'); |
| 21 | +throws('bad syntax', '-moz-osx-font-smoothing: grayscale', 'Expected a pseudo-class or pseudo-element.'); |
| 22 | +throws('bad syntax (2)', '! .body', 'Unexpected \'!\'. Escaping special characters with \\ may help.'); |
23 | 23 |
|
24 | 24 | throws('missing backslash for semicolon', '.;');
|
25 | 25 | throws('missing backslash for semicolon (2)', '.\;');
|
26 | 26 | throws('unexpected / foo', '-Option\/root', "Unexpected '/'. Escaping special characters with \\ may help.");
|
27 | 27 | throws('bang in selector', '.foo !optional', "Unexpected '!'. Escaping special characters with \\ may help.");
|
| 28 | + |
| 29 | +throws('misplaced parenthesis', ':not(', 'Expected a closing parenthesis.'); |
| 30 | +throws('misplaced parenthesis (2)', ':not)', 'Expected an opening parenthesis.'); |
| 31 | +throws('misplaced parenthesis (3)', ':not((', 'Expected a closing parenthesis.'); |
| 32 | +throws('misplaced parenthesis (4)', ':not))', 'Expected an opening parenthesis.'); |
0 commit comments