Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update test suites to leverage @web/test-runner and esm supported libraries #6847

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci-validate-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ jobs:
run: yarn prepare

- name: Install playwright dependencies and browsers
run: |
yarn playwright install-deps
yarn playwright install
run: npx playwright install --with-deps
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been a pain point for a while now - we're mixing NPM and Yarn across the repo and it's possible that this could result in conflicts since we're all using yarn locally, but the CI is using NPM. It makes it more complicated to debug when something goes wrong on the pipeline.

We should either be using only Yarn everywhere or only NPM everywhere, not both.


- name: Run tests in changed packages
if: ${{ github.event_name == 'pull_request' }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci-validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ jobs:
run: yarn prepare

- name: Install playwright dependencies and browsers
run: |
yarn playwright install-deps
yarn playwright install
run: npx playwright install --with-deps

- name: Testing unit tests
run: yarn lerna run test --stream
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "update to use web test runner",
"packageName": "@microsoft/fast-colors",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "update to use web test runner",
"packageName": "@microsoft/fast-element",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "update to use web test runner",
"packageName": "@microsoft/fast-foundation",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "update to use web test runner",
"packageName": "@microsoft/fast-react-wrapper",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "update to use web test runner",
"packageName": "@microsoft/fast-router",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "update playwright version",
"packageName": "@microsoft/fast-ssr",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "update to use web test runner",
"packageName": "@microsoft/fast-web-utilities",
"email": "[email protected]",
"dependentChangeType": "none"
}
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
"examples/ssr"
],
"nohoist": [
"**/@types/chai",
"**/@types/jest",
"**/@types/karma",
"**/@types/mocha",
"**/@types/node",
"**/chai",
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@
"watch": "yarn build -- -w --preserveWatchOutput"
},
"devDependencies": {
"@types/chai": "^4.2.11",
"@esm-bundle/chai": "4.3.4-fix.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a weird nonstandard version of a package that hasn't been published in over a year:

esm-bundle/chai#280
esm-bundle/chai#315

"@types/mocha": "^8.2.0",
"chai": "^4.2.0",
"mocha": "^8.2.1",
"@microsoft/eslint-config-fast-dna": "^2.1.0",
"eslint-config-prettier": "^8.8.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/utilities/fast-colors/src/color-blending.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chai from "chai";
import { expect } from "@esm-bundle/chai";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chai version 5 is currently in alpha but is rewritten to only support ESM. Will we go back to Chai proper once it's stable?

https://github.com/chaijs/chai/releases/tag/v5.0.0-alpha.2

import { test } from "mocha";
import { testData } from "./__test__/testData.js";
import {
Expand All @@ -16,7 +16,7 @@ import {
lightenViaLAB,
saturateViaLCH,
} from "./index.js";
const expect = chai.expect;

const testPrecision: number = 4;

describe("Color blending functions", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/color-converters.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chai from "chai";
import { expect } from "@esm-bundle/chai";
import { test } from "mocha";
import { testData } from "./__test__/testData.js";
import {
Expand Down Expand Up @@ -28,7 +28,6 @@ import {
xyzToLAB,
xyzToRGB,
} from "./index.js";
const expect = chai.expect;

const testPrecision: number = 4;

Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/color-palette.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chai from "chai";
import { expect } from "@esm-bundle/chai";
import { test } from "mocha";
import { testData } from "./__test__/testData.js";
import {
Expand All @@ -9,7 +9,6 @@ import {
} from "./color-palette.js";
import { ColorRGBA64 } from "./color-rgba-64.js";
import { parseColorHexRGB } from "./parse-color.js";
const expect = chai.expect;

const testPrecision: number = 4;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import chai from "chai";
import { expect } from "@esm-bundle/chai";
import { test } from "mocha";
import { test200ImageData } from "./__test__/test200.js";
import { testGrey200ImageData } from "./__test__/testGrey200.js";
import { ArrayPixelBlob } from "./array-pixel-blob.js";
import { quantize, QuantizedColor } from "./color-quantization.js";
const expect = chai.expect;

describe("Generating a histogram from an image", (): void => {
test("quantize with default settings", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/histogram.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import chai from "chai";
import { expect } from "@esm-bundle/chai";
import { test } from "mocha";
import { test200ImageData } from "./__test__/test200.js";
import { Histogram } from "./histogram.js";
import { ArrayPixelBlob } from "./array-pixel-blob.js";
const expect = chai.expect;

describe("Generating a histogram from an image", (): void => {
test("getHistogramIndex", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/palette-extractor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import chai from "chai";
import { expect } from "@esm-bundle/chai";
import { test } from "mocha";
import { test200ImageData } from "./__test__/test200.js";
import { testGrey200ImageData } from "./__test__/testGrey200.js";
import { ArrayPixelBlob } from "./array-pixel-blob.js";
import { quantize, QuantizedColor } from "./color-quantization.js";
import { extractPalette, PaletteEntry } from "./palette-extractor.js";
const expect = chai.expect;

describe("Extracting a palette from a set of colors", (): void => {
test("Extract palette with default settings", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/utilities/fast-colors/src/parse-color.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import chai from "chai";
import { expect } from "@esm-bundle/chai";
import { test } from "mocha";
import { testData } from "./__test__/testData.js";
import {
Expand All @@ -16,7 +16,6 @@ import {
parseColorWebRGB,
parseColorWebRGBA,
} from "./index.js";
const expect = chai.expect;

const testPrecision: number = 4;
const hexDigits: string[] = [
Expand Down
141 changes: 0 additions & 141 deletions packages/utilities/fast-react-wrapper/karma.conf.cjs

This file was deleted.

Loading