Skip to content

Commit 7ae1a17

Browse files
committed
Add test for unrecognized languages
1 parent a6261ad commit 7ae1a17

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/highlight.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,19 @@ describe("Detect breaking changes in highlight.js", function() {
2121
.then(done)
2222
.done();
2323
});
24+
25+
it('should return a safe code block for unrecognized languages', function (done) {
26+
tester.builder()
27+
.withContent('```foo\nif (foo <= bar) { console.log(\'Too bad, foo...\'); }\n```')
28+
.withLocalPlugin(pluginDir)
29+
.create()
30+
.then(function(result) {
31+
var expected = '<pre><code class="lang-foo">if (foo &lt;= bar) { console.log(&apos;Too bad, foo...&apos;); }\n</code></pre>';
32+
if (result.get('index.html').content !== expected) {
33+
throw new Error('Found ' + result[0].content + ' instead of ' + expected);
34+
}
35+
})
36+
.then(done)
37+
.done();
38+
});
2439
});

0 commit comments

Comments
 (0)