Skip to content

Commit

Permalink
feat: Add support of mdbook-open-on-gh plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jontze committed Sep 14, 2021
1 parent fbdd674 commit d538a3e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/mdbook/plugins/OpenGh.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { OpenGh } from "./OpenGh";

import * as PluginModule from "./MdPlugin";

jest.mock("./MdPlugin");

describe("OpenGh", () => {
it("should construct class", () => {
const constructorSpy = jest.spyOn(PluginModule, "MdPlugin");

const openGhPlugin = new OpenGh();

expect(openGhPlugin).toBeDefined();
expect(constructorSpy).toHaveBeenCalledWith(
"badboy/mdbook-open-on-gh",
"opengh-version",
"mdbook-open-on-gh",
"unknown-linux-gnu"
);
});
});
12 changes: 12 additions & 0 deletions src/mdbook/plugins/OpenGh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { MdPlugin } from "./MdPlugin";

export class OpenGh extends MdPlugin {
constructor() {
super(
"badboy/mdbook-open-on-gh",
"opengh-version",
"mdbook-open-on-gh",
"unknown-linux-gnu"
);
}
}

0 comments on commit d538a3e

Please sign in to comment.