exceptions.js 1.5 KB

123456789101112131415161718192021222324
  1. "use strict";
  2. var _helpers = require("./util/helpers");
  3. // Unclosed elements
  4. (0, _helpers["throws"])('unclosed string', 'a[href="wow]');
  5. (0, _helpers["throws"])('unclosed comment', '/* oops');
  6. (0, _helpers["throws"])('unclosed pseudo element', 'button::');
  7. (0, _helpers["throws"])('unclosed pseudo class', 'a:');
  8. (0, _helpers["throws"])('unclosed attribute selector', '[name="james"][href');
  9. (0, _helpers["throws"])('no opening parenthesis', ')');
  10. (0, _helpers["throws"])('no opening parenthesis (2)', ':global.foo)');
  11. (0, _helpers["throws"])('no opening parenthesis (3)', 'h1:not(h2:not(h3)))');
  12. (0, _helpers["throws"])('no opening square bracket', ']');
  13. (0, _helpers["throws"])('no opening square bracket (2)', ':global.foo]');
  14. (0, _helpers["throws"])('no opening square bracket (3)', '[global]]');
  15. (0, _helpers["throws"])('bad pseudo element', 'button::"after"');
  16. (0, _helpers["throws"])('missing closing parenthesis in pseudo', ':not([attr="test"]:not([attr="test"])');
  17. (0, _helpers["throws"])('bad syntax', '-moz-osx-font-smoothing: grayscale');
  18. (0, _helpers["throws"])('bad syntax (2)', '! .body');
  19. (0, _helpers["throws"])('missing backslash for semicolon', '.;');
  20. (0, _helpers["throws"])('missing backslash for semicolon (2)', '.\;');
  21. (0, _helpers["throws"])('unexpected / foo', '-Option\/root', "Unexpected '/'. Escaping special characters with \\ may help.");
  22. (0, _helpers["throws"])('bang in selector', '.foo !optional', "Unexpected '!'. Escaping special characters with \\ may help.");