json-schema-spell-checker
Version:
Check the spelling of your JSON Schema (including OpenAPI!) documents
28 lines (23 loc) • 936 B
JavaScript
import check from "./check.js";
test("no spelling errors (plain)", async () => {
const item = { value: "This doesn't have any spelling errors" };
const actual = await check(item);
expect(actual.errors).toEqual([]);
});
test("no spelling errors (markdown)", async () => {
const item = { value: "This doesn't have *any* spelling errors" };
const actual = await check(item);
expect(actual.errors).toEqual([]);
});
test("spelling errors (plain)", async () => {
const item = { value: "This *has* a speling error" };
const actual = await check(item);
expect(actual.value).toEqual(item.value);
expect(actual.errors).toEqual([{ index: 23, word: "speling" }]);
});
test("spelling errors (markdown)", async () => {
const item = { value: "This *has* a speling error" };
const actual = await check(item);
expect(actual.value).toEqual(item.value);
expect(actual.errors).toEqual([{ index: 23, word: "speling" }]);
});