Bump test dependencies (#9244)

This commit is contained in:
Bram Kragten 2021-05-26 10:02:02 +02:00 committed by GitHub
parent b6c5223221
commit 3cc4628d03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 334 additions and 341 deletions

4
.mocharc.cjs Normal file
View File

@ -0,0 +1,4 @@
module.exports = {
require: "test-mocha/testconf.js",
timeout: 10000,
};

View File

@ -16,7 +16,7 @@
"lint:lit": "lit-analyzer \"**/src/**/*.ts\" --format markdown --outFile result.md", "lint:lit": "lit-analyzer \"**/src/**/*.ts\" --format markdown --outFile result.md",
"lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types", "lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types",
"format": "yarn run format:eslint && yarn run format:prettier", "format": "yarn run format:eslint && yarn run format:prettier",
"mocha": "node_modules/.bin/ts-mocha -p test-mocha/tsconfig.test.json --opts test-mocha/mocha.opts", "mocha": "ts-mocha -p test-mocha/tsconfig.test.json \"test-mocha/**/*.ts\"",
"test": "yarn run lint && yarn run mocha" "test": "yarn run lint && yarn run mocha"
}, },
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)", "author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
@ -165,15 +165,16 @@
"@rollup/plugin-json": "^4.0.3", "@rollup/plugin-json": "^4.0.3",
"@rollup/plugin-node-resolve": "^7.1.3", "@rollup/plugin-node-resolve": "^7.1.3",
"@rollup/plugin-replace": "^2.3.2", "@rollup/plugin-replace": "^2.3.2",
"@types/chai": "^4.1.7", "@types/chai": "^4.2.18",
"@types/chromecast-caf-receiver": "^5.0.11", "@types/chromecast-caf-receiver": "^5.0.11",
"@types/chromecast-caf-sender": "^1.0.3", "@types/chromecast-caf-sender": "^1.0.3",
"@types/js-yaml": "^4.0.1", "@types/js-yaml": "^4.0.1",
"@types/leaflet": "^1.7.0", "@types/leaflet": "^1.7.0",
"@types/leaflet-draw": "^1.0.3", "@types/leaflet-draw": "^1.0.3",
"@types/marked": "^1.2.2", "@types/marked": "^1.2.2",
"@types/mocha": "^7.0.2", "@types/mocha": "^8.2.2",
"@types/resize-observer-browser": "^0.1.3", "@types/resize-observer-browser": "^0.1.3",
"@types/sinon": "^10.0.0",
"@types/sortablejs": "^1.10.6", "@types/sortablejs": "^1.10.6",
"@types/webspeechapi": "^0.0.29", "@types/webspeechapi": "^0.0.29",
"@typescript-eslint/eslint-plugin": "^4.22.0", "@typescript-eslint/eslint-plugin": "^4.22.0",
@ -181,7 +182,7 @@
"@web/dev-server": "^0.0.24", "@web/dev-server": "^0.0.24",
"@web/dev-server-rollup": "^0.2.11", "@web/dev-server-rollup": "^0.2.11",
"babel-loader": "^8.1.0", "babel-loader": "^8.1.0",
"chai": "^4.2.0", "chai": "^4.3.4",
"cpx": "^1.5.0", "cpx": "^1.5.0",
"del": "^4.0.0", "del": "^4.0.0",
"eslint": "^7.25.0", "eslint": "^7.25.0",
@ -209,7 +210,7 @@
"magic-string": "^0.25.7", "magic-string": "^0.25.7",
"map-stream": "^0.0.7", "map-stream": "^0.0.7",
"merge-stream": "^1.0.1", "merge-stream": "^1.0.1",
"mocha": "^7.2.0", "mocha": "^8.4.0",
"object-hash": "^2.0.3", "object-hash": "^2.0.3",
"open": "^7.0.4", "open": "^7.0.4",
"prettier": "^2.0.4", "prettier": "^2.0.4",
@ -220,12 +221,12 @@
"rollup-plugin-terser": "^5.3.0", "rollup-plugin-terser": "^5.3.0",
"rollup-plugin-visualizer": "^4.0.4", "rollup-plugin-visualizer": "^4.0.4",
"serve": "^11.3.0", "serve": "^11.3.0",
"sinon": "^7.3.1", "sinon": "^11.0.0",
"source-map-url": "^0.4.0", "source-map-url": "^0.4.0",
"systemjs": "^6.3.2", "systemjs": "^6.3.2",
"terser-webpack-plugin": "^5.1.1", "terser-webpack-plugin": "^5.1.1",
"ts-lit-plugin": "^1.2.1", "ts-lit-plugin": "^1.2.1",
"ts-mocha": "^7.0.0", "ts-mocha": "^8.0.0",
"typescript": "^4.2.4", "typescript": "^4.2.4",
"vinyl-buffer": "^1.0.1", "vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0", "vinyl-source-stream": "^2.0.0",

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { DEFAULT_VIEW_ENTITY_ID } from "../../../src/common/const"; import { DEFAULT_VIEW_ENTITY_ID } from "../../../src/common/const";
import { extractViews } from "../../../src/common/entity/extract_views"; import { extractViews } from "../../../src/common/entity/extract_views";
import { createEntities, createView } from "./test_util"; import { createEntities, createView } from "./test_util";

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { getGroupEntities } from "../../../src/common/entity/get_group_entities"; import { getGroupEntities } from "../../../src/common/entity/get_group_entities";

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { getViewEntities } from "../../../src/common/entity/get_view_entities"; import { getViewEntities } from "../../../src/common/entity/get_view_entities";

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { splitByGroups } from "../../../src/common/entity/split_by_groups"; import { splitByGroups } from "../../../src/common/entity/split_by_groups";

View File

@ -1,5 +1,5 @@
import { assert } from "chai"; import { assert } from "chai";
import * as sinon from "sinon"; import { useFakeTimers } from "sinon";
import { timerTimeRemaining } from "../../../src/data/timer"; import { timerTimeRemaining } from "../../../src/data/timer";
@ -31,7 +31,7 @@ describe("timerTimeRemaining", () => {
describe("active timers", () => { describe("active timers", () => {
let clock; let clock;
beforeEach(() => { beforeEach(() => {
clock = sinon.useFakeTimers(new Date("2018-01-17T16:15:30Z")); clock = useFakeTimers(new Date("2018-01-17T16:15:30Z"));
}); });
afterEach(() => { afterEach(() => {
clock.restore(); clock.restore();

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import parseAspectRatio from "../../../src/common/util/parse-aspect-ratio"; import parseAspectRatio from "../../../src/common/util/parse-aspect-ratio";

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { import {
ExternalMessaging, ExternalMessaging,

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { createHassioSession } from "../../src/data/hassio/ingress"; import { createHassioSession } from "../../src/data/hassio/ingress";
describe("Create hassio session", function () { describe("Create hassio session", function () {
@ -44,7 +44,9 @@ describe("Create hassio session", function () {
it("Test fail to create", async function () { it("Test fail to create", async function () {
const createSessionPromise = createHassioSession({ const createSessionPromise = createHassioSession({
// @ts-ignore // @ts-ignore
callApi: async function () {}, callApi: async function () {
// noop
},
}).then( }).then(
() => true, () => true,
() => false () => false

View File

@ -1,4 +0,0 @@
--require test-mocha/testconf.js
--recursive
--timeout 10000
test-mocha/**/*.ts

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { import {
swapCard, swapCard,
@ -43,7 +43,7 @@ describe("swapCard", () => {
}; };
const result = swapCard(config, [0, 0], [1, 1]); const result = swapCard(config, [0, 0], [1, 1]);
const expected = { const expected: LovelaceConfig = {
views: [ views: [
{ {
cards: [{ type: "v2-c2" }, { type: "v1-c2" }], cards: [{ type: "v2-c2" }, { type: "v1-c2" }],
@ -69,7 +69,7 @@ describe("moveCard", () => {
}; };
const result = moveCard(config, [1, 0], [0]); const result = moveCard(config, [1, 0], [0]);
const expected = { const expected: LovelaceConfig = {
views: [ views: [
{ {
cards: [{ type: "card1" }], cards: [{ type: "card1" }],
@ -95,7 +95,7 @@ describe("moveCard", () => {
}; };
const result = moveCard(config, [1, 0], [0]); const result = moveCard(config, [1, 0], [0]);
const expected = { const expected: LovelaceConfig = {
views: [ views: [
{ {
cards: [{ type: "v1-c1" }, { type: "v1-c2" }, { type: "v2-c1" }], cards: [{ type: "v1-c1" }, { type: "v1-c2" }, { type: "v2-c1" }],
@ -147,7 +147,7 @@ describe("swapView", () => {
}; };
const result = swapView(config, 1, 0); const result = swapView(config, 1, 0);
const expected = { const expected: LovelaceConfig = {
views: [ views: [
{ {
title: "view2", title: "view2",
@ -177,7 +177,7 @@ describe("swapView", () => {
}; };
const result = swapView(config, 0, 0); const result = swapView(config, 0, 0);
const expected = { const expected: LovelaceConfig = {
views: [ views: [
{ {
title: "view1", title: "view1",

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { import {
getValueInPercentage, getValueInPercentage,
normalize, normalize,
@ -7,19 +7,19 @@ import {
describe("Calculate tests", function () { describe("Calculate tests", function () {
it("Test getValueInPercentage", function () { it("Test getValueInPercentage", function () {
assert.equal(getValueInPercentage(10, 0, 100), 10); assert.strictEqual(getValueInPercentage(10, 0, 100), 10);
assert.equal(getValueInPercentage(120, 0, 100), 120); assert.strictEqual(getValueInPercentage(120, 0, 100), 120);
assert.equal(getValueInPercentage(-10, 0, 100), -10); assert.strictEqual(getValueInPercentage(-10, 0, 100), -10);
assert.equal(getValueInPercentage(10.33333, 0, 100), 10.33333); assert.strictEqual(getValueInPercentage(10.33333, 0, 100), 10.33333);
}); });
it("Test normalize", function () { it("Test normalize", function () {
assert.equal(normalize(10, 0, 100), 10); assert.strictEqual(normalize(10, 0, 100), 10);
assert.equal(normalize(1, 10, 100), 10); assert.strictEqual(normalize(1, 10, 100), 10);
assert.equal(normalize(100, 0, 10), 10); assert.strictEqual(normalize(100, 0, 10), 10);
}); });
it("Test roundWithOneDecimal", function () { it("Test roundWithOneDecimal", function () {
assert.equal(roundWithOneDecimal(10), 10); assert.strictEqual(roundWithOneDecimal(10), 10);
assert.equal(roundWithOneDecimal(10.3), 10.3); assert.strictEqual(roundWithOneDecimal(10.3), 10.3);
assert.equal(roundWithOneDecimal(10.3333), 10.3); assert.strictEqual(roundWithOneDecimal(10.3333), 10.3);
}); });
}); });

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { brandsUrl } from "../../src/util/brands-url"; import { brandsUrl } from "../../src/util/brands-url";
describe("Generate brands Url", function () { describe("Generate brands Url", function () {

View File

@ -1,4 +1,4 @@
import * as assert from "assert"; import { assert } from "chai";
import { documentationUrl } from "../../src/util/documentation-url"; import { documentationUrl } from "../../src/util/documentation-url";
describe("Generate documentation URL", function () { describe("Generate documentation URL", function () {

592
yarn.lock

File diff suppressed because it is too large Load Diff