explicitLanguage.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. 'use strict';
  2. let utility = require('../utility');
  3. describe('explicit language class', function() {
  4. before(function() {
  5. const filename = utility.buildPath('fixtures', 'expect', 'explicit1.txt'),
  6. testHTML = document.querySelectorAll('#explicit-language .hljs');
  7. return utility.setupFile(filename, 'utf-8', this, testHTML);
  8. });
  9. it('should highlight block with language in code tag', function() {
  10. const actual = this.blocks[0];
  11. actual.should.equal(this.expected);
  12. });
  13. it('should highlight block with language in pre tag', function() {
  14. const actual = this.blocks[1];
  15. actual.should.equal(this.expected);
  16. });
  17. it('should highlight using html 5 style (language-*)', function() {
  18. const actual = this.blocks[2];
  19. actual.should.equal(this.expected);
  20. });
  21. it('should highlight with shortened prefix (lang-)', function() {
  22. const filename = utility.buildPath('fixtures', 'expect', 'explicit2.txt'),
  23. actual = this.blocks[3];
  24. return utility.expectedFile(filename, 'utf-8', actual);
  25. });
  26. it('should highlight if classname contains uppercase symbols', function() {
  27. const filename = utility.buildPath('fixtures', 'expect', 'explicit2.txt'),
  28. actual = this.blocks[4];
  29. return utility.expectedFile(filename, 'utf-8', actual);
  30. });
  31. });