Paulus Schoutsen cdb2093ea6
Ts all the tests (#1998)
* 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
2018-11-06 10:09:09 +01:00

21 lines
611 B
TypeScript

import { assert } from "chai";
import formatDateTime from "../../../src/common/datetime/format_date_time";
describe("formatDateTime", () => {
const dateObj = new Date(2017, 10, 18, 11, 12, 13, 1400);
it("Formats English date times", () => {
assert.strictEqual(
formatDateTime(dateObj, "en"),
"November 18, 2017, 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 date times", () => {
assert.strictEqual(formatDateTime(dateObj, "fr"), "2017 M11 18 11:12");
});
});