all repos — archive/homestead @ e7b08b1dfe3f2a2596deb6e2a72bb79805d3708f

My future indieweb platform

feat: Add code block highlighting Theme is configurable

Alan Pearce
commit

e7b08b1dfe3f2a2596deb6e2a72bb79805d3708f

parent

a67e38d1a82c95db5bd24183e81b31438f60dd2c

1 file changed, 18 insertions(+), 4 deletions(-)

changed files
M test/app.test.jstest/app.test.js
@@ -9,7 +9,9 @@
process.chdir(path.resolve(__dirname, "./testsite/")); const config = require(path.resolve(__dirname, "../src/modules/config.js")); -const app = require("../src/app.js"); +const App = require("../src/app.js"); +let app; +test.before(async t => (app = await App())); const parseResponse = res => cheerio.load(res.text, {
@@ -52,7 +54,8 @@
t.deepEqual(count, { "h-card": 1, "h-feed": 1, - "h-entry": 1 + "h-entry": 1, + rels: 1 }); const data = await mf.getAsync(options);
@@ -82,7 +85,8 @@ const count = await mf.countAsync(options);
t.deepEqual(count, { "h-card": 1, - "h-entry": 1 + "h-entry": 1, + rels: 1 }); const data = await mf.getAsync(options);
@@ -111,12 +115,22 @@
t.deepEqual(count, { "h-card": 1, "h-feed": 1, - "h-entry": 1 + "h-entry": 1, + rels: 1 }); const data = await mf.getAsync(options); t.snapshot(data, "should contain relevant microformats data"); +}); + +test("highlight css", async function(t) { + const res = await request(app.listen()).get("/css/code.css"); + + t.is(res.statusCode, 200); + t.is(res.type, "text/css"); + t.is(res.charset, "utf-8"); + t.regex(res.text, /^\.hljs/m); }); test(notFound, "/post/non-existent", /Post not found/);