honkit
Version:
HonKit is building beautiful books using Markdown.
20 lines (19 loc) • 976 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const path_2 = __importDefault(require("../path"));
describe("Paths", () => {
describe("setExtension", () => {
test("should correctly change extension of filename", () => {
expect(path_2.default.setExtension("test.md", ".html")).toBe("test.html");
expect(path_2.default.setExtension("test.md", ".json")).toBe("test.json");
});
test("should correctly change extension of path", () => {
expect(path_2.default.setExtension("hello/test.md", ".html")).toBe(path_1.default.normalize("hello/test.html"));
expect(path_2.default.setExtension("hello/test.md", ".json")).toBe(path_1.default.normalize("hello/test.json"));
});
});
});