vuepress-plugin-auto-sidebar
Version:
A vuepress plugin for generate sidebar
21 lines (20 loc) • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const sidebar_1 = require("../utils/sidebar");
describe('sidebar', () => {
it('title should be ok', () => {
expect('hello'.match(sidebar_1.titleReg)).toBeTruthy();
expect('hello world'.match(sidebar_1.titleReg)).toBeTruthy();
expect('hello\tworld'.match(sidebar_1.titleReg)).toBeTruthy();
expect('hello-world'.match(sidebar_1.titleReg)).toBeTruthy();
expect('hello_world'.match(sidebar_1.titleReg)).toBeTruthy();
expect('hello.world'.match(sidebar_1.titleReg)).toBeTruthy();
});
it('title should be false', () => {
expect('你好'.match(sidebar_1.titleReg)).toBeFalsy();
expect('こんにちは'.match(sidebar_1.titleReg)).toBeFalsy();
expect('안녕하십니까'.match(sidebar_1.titleReg)).toBeFalsy();
expect('hello你好'.match(sidebar_1.titleReg)).toBeFalsy();
expect('hello🔥'.match(sidebar_1.titleReg)).toBeFalsy();
});
});