dev-to-git
Version:
A CLI to keep your dev.to posts in sync from a GIT project, using the CI provider of your choice
34 lines • 1.85 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var article_1 = require("./article");
describe("Article", function () {
var article;
var repository = { username: "maxime1992", name: 'dev-to-git' };
var relativePathToArticle = "./test/article.md";
beforeEach(function () {
article = new article_1.Article({
id: 0,
relativePathToArticle: relativePathToArticle,
repository: repository,
}, 'private-dev-to-token');
});
describe("Read", function () {
var articleRead;
beforeEach(function () {
articleRead = article.readArticleOnDisk();
});
it("should read an article from the configuration", function () {
expect(articleRead).toContain("This is my awesome article!");
expect(articleRead).toContain("Hey, some text!");
});
it("should rewrite the local images URLs to match the raw file on github", function () {
expect(articleRead).toContain("Image 1: ");
expect(articleRead).toContain("Image 2: ");
expect(articleRead).toContain("Image 3: ");
});
it("should NOT rewrite absolute images URLs to match the raw file on github", function () {
expect(articleRead).toContain("Absolute image: ");
});
});
});
//# sourceMappingURL=article.spec.js.map
;