This converts all pure tests to Jest. This was done by first running `npx jest-codemods` with the Mocha transformation, then manually fixing any places where it hadn't automatically converted the correct thing or had missed things (mostly Sinon). This also sets up VSCode correctly for running Jest.
19 lines
704 B
TypeScript
19 lines
704 B
TypeScript
import { pluralize } from "../../src/pure/word";
|
|
|
|
describe("word helpers", () => {
|
|
describe("pluralize", () => {
|
|
it("should return the plural form if the number is 0", () => {
|
|
expect(pluralize(0, "thing", "things")).toBe("0 things");
|
|
});
|
|
it("should return the singular form if the number is 1", () => {
|
|
expect(pluralize(1, "thing", "things")).toBe("1 thing");
|
|
});
|
|
it("should return the plural form if the number is greater than 1", () => {
|
|
expect(pluralize(7, "thing", "things")).toBe("7 things");
|
|
});
|
|
it("should return the empty string if the number is undefined", () => {
|
|
expect(pluralize(undefined, "thing", "things")).toBe("");
|
|
});
|
|
});
|
|
});
|