Skip to content

Commit

Permalink
ci: updates test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dresende committed Jul 31, 2024
1 parent 2a0ff20 commit 7a2c646
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/Resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { resolve } from "path";

export function Resolver(extension) {
return (path, base = null) => {
if (path == "empty://") {
return path;
}

if (!path.endsWith(`.${extension}`)) {
path += `.${extension}`;
}
Expand Down
6 changes: 6 additions & 0 deletions test/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ describe("Renderer", () => {
view.should.be.instanceOf(Promise);
});

it("compilePath accepts empty:// as filename", async () => {
const view = await keikan.compilePath("empty://");

view().should.be.equal("");
});

it("compilePath returns a view that can then be renderer", async () => {
const view = await keikan.compilePath(import.meta.dirname + "/views/simple");

Expand Down
1 change: 1 addition & 0 deletions test/views/has-include.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<h3>
<% let foo = "bar" %>
<% include label({ name }) %>
</h3>

0 comments on commit 7a2c646

Please sign in to comment.