* Convert tests to TypeScript * Add types for tests * Rename files to TS * Fix up test imports * Fix TSC errors * Liiiint * Add types to util method signatures * Some more types
18 lines
531 B
TypeScript
18 lines
531 B
TypeScript
import { assert } from "chai";
|
|
|
|
import formatTime from "../../../src/common/datetime/format_time";
|
|
|
|
describe("formatTime", () => {
|
|
const dateObj = new Date(2017, 10, 18, 11, 12, 13, 1400);
|
|
|
|
it("Formats English times", () => {
|
|
assert.strictEqual(formatTime(dateObj, "en"), "11:12 AM");
|
|
});
|
|
|
|
// Node only contains intl support for english formats. This test at least ensures
|
|
// the fallback to a different locale
|
|
it("Formats other times", () => {
|
|
assert.strictEqual(formatTime(dateObj, "fr"), "11:12");
|
|
});
|
|
});
|