1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-02-15 07:25:54 +00:00
* Add rspack

* Remove TransformAsyncModulesPlugin from rspack

* Migrate all webpack usage to rspack

* Migrate tests to vitest

* Fix test suites

* Remove chai dependency

* Fix compute_state_display tests

* Fix resolveTimeZone

* Reduces test pipeline

* Revert test ci

* optimize chunk filtering

* Migrate landing-page to rspack

* Update rspack dependencies

* Add rsdoctor

* Fix prod build bundle size

* Use rsdoctor for demo stats

* Remove unused webpack configs

* Update build-scripts/rspack.cjs

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>

* Fix eslint

* Update rspack

* Remove unused code

---------

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
This commit is contained in:
Wendelin
2024-11-26 14:49:13 +01:00
committed by GitHub
parent 09c5dab69f
commit bd0bfc1fbe
72 changed files with 2199 additions and 1232 deletions

View File

@@ -1,23 +1,23 @@
import { assert } from "chai";
import { assert, describe, it } from "vitest";
import {
getValueInPercentage,
normalize,
roundWithOneDecimal,
} from "../../src/util/calculate";
describe("Calculate tests", function () {
it("Test getValueInPercentage", function () {
describe("Calculate tests", () => {
it("Test getValueInPercentage", () => {
assert.strictEqual(getValueInPercentage(10, 0, 100), 10);
assert.strictEqual(getValueInPercentage(120, 0, 100), 120);
assert.strictEqual(getValueInPercentage(-10, 0, 100), -10);
assert.strictEqual(getValueInPercentage(10.33333, 0, 100), 10.33333);
});
it("Test normalize", function () {
it("Test normalize", () => {
assert.strictEqual(normalize(10, 0, 100), 10);
assert.strictEqual(normalize(1, 10, 100), 10);
assert.strictEqual(normalize(100, 0, 10), 10);
});
it("Test roundWithOneDecimal", function () {
it("Test roundWithOneDecimal", () => {
assert.strictEqual(roundWithOneDecimal(10), 10);
assert.strictEqual(roundWithOneDecimal(10.3), 10.3);
assert.strictEqual(roundWithOneDecimal(10.3333), 10.3);

View File

@@ -1,4 +1,4 @@
import { assert } from "chai";
import { assert, describe, it } from "vitest";
import { brandsUrl } from "../../src/util/brands-url";
describe("Generate brands Url", () => {

View File

@@ -1,15 +1,15 @@
import { assert } from "chai";
import { assert, describe, it } from "vitest";
import { documentationUrl } from "../../src/util/documentation-url";
describe("Generate documentation URL", function () {
it("Generate documentation url for stable", function () {
describe("Generate documentation URL", () => {
it("Generate documentation url for stable", () => {
assert.strictEqual(
// @ts-ignore
documentationUrl({ config: { version: "1.0.0" } }, "/blog"),
"https://www.home-assistant.io/blog"
);
});
it("Generate documentation url for rc", function () {
it("Generate documentation url for rc", () => {
assert.strictEqual(
// @ts-ignore
documentationUrl({ config: { version: "1.0.0b0" } }, "/blog"),