1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-23 10:20:10 +01:00

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
This commit is contained in:
Paulus Schoutsen
2018-11-06 10:09:09 +01:00
committed by GitHub
parent 856ef34964
commit cdb2093ea6
78 changed files with 524 additions and 364 deletions

View File

@@ -0,0 +1,17 @@
import { assert } from "chai";
import formatDate from "../../../src/common/datetime/format_date";
describe("formatDate", () => {
const dateObj = new Date(2017, 10, 18, 11, 12, 13, 1400);
it("Formats English dates", () => {
assert.strictEqual(formatDate(dateObj, "en"), "November 18, 2017");
});
// Node only contains intl support for english formats. This test at least ensures
// the fallback to a different locale
it("Formats other dates", () => {
assert.strictEqual(formatDate(dateObj, "fr"), "2017 M11 18");
});
});