UNPKG

honkit

Version:

HonKit is building beautiful books using Markdown.

30 lines (29 loc) 1.36 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const removePlugin_1 = __importDefault(require("../removePlugin")); const config_1 = __importDefault(require("../../../models/config")); describe("removePlugin", () => { const config = config_1.default.createWithValues({ plugins: ["hello", "world", "-disabled"], }); test("should remove the plugin from the list", () => { const newConfig = (0, removePlugin_1.default)(config, "hello"); const testDep = newConfig.getPluginDependency("hello"); expect(testDep).toBeUndefined(); }); test("should remove the disabled plugin from the list", () => { const newConfig = (0, removePlugin_1.default)(config, "disabled"); const testDep = newConfig.getPluginDependency("disabled"); expect(testDep).toBeUndefined(); }); test("should disable default plugin", () => { const newConfig = (0, removePlugin_1.default)(config, "search"); const disabledDep = newConfig.getPluginDependency("search"); expect(disabledDep).toBeDefined(); expect(disabledDep.getVersion()).toEqual("*"); expect(disabledDep.isEnabled()).toBeFalsy(); }); });