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

♻️ Migrate core tests to native node test runner #248

Merged
merged 2 commits into from
Mar 7, 2024
Merged
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
11 changes: 5 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"clean": "rm -rf dist *.tsbuildinfo",
"lint": "eslint \"{src,test}/**/*.ts\"",
"check:types": "tsc --noEmit",
"test:unit": "mocha \"test/**/*.test.ts\"",
"test:unit": "tsx --test --no-deprecation",
"test:types": "dtslint types --localTs ../../node_modules/typescript/lib --expectOnly",
"test": "yarn test:unit && yarn test:types",
"docs": "rm -rf docs && yarn typedoc --options typedoc.json",
Expand All @@ -47,14 +47,13 @@
"@types/express": "^4.17.6",
"@types/jsdom": "^16.2.3",
"@types/lodash.isequal": "^4.5.5",
"@types/mocha": "^7.0.1",
"@types/node": "^14.17.5",
"@types/node": "^20.11.25",
"tsx": "^4.7.1",
"dtslint": "^4.0.5",
"expect": "^24.9.0",
"express": "^4.17.1",
"jsdom": "^16.2.2",
"mocha": "^6.2.2",
"ts-node": "^10.4.0",
"jsdom": "^24.0.0",

"typedoc": "^0.22.7",
"typescript": "~4.4.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/create-interactor.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from './helpers';
import { Datepicker, Details, Div, Header, Link, MainNav, TextField } from './fixtures';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/extend.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from './helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/filter-delegate.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from './helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { beforeEach } from "mocha";
import { afterEach, beforeEach } from "node:test";
import { DOMWindow, JSDOM } from "jsdom";
import { addInteractionWrapper, globals, setDocumentResolver, setInteractorTimeout } from "@interactors/globals";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/inspector.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from './helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/interactor.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from './helpers';
import { Header, Link, MainNav } from './fixtures';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/locator.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from './helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/matcher.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from './helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/matchers/and.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from '../helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/matchers/every.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from '../helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/matchers/including.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from '../helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/matchers/matching.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { beforeEach, describe, it } from 'node:test';
import expect from 'expect';
import { dom } from '../helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/matchers/not.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from '../helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/matchers/or.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from '../helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/matchers/some.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from '../helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/selector.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { dom } from './helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/serialize.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from "mocha";
import { describe, it } from "node:test";
import expect from "expect";
import { HTML, TextField } from "./fixtures";
import { including, or } from "../src";
Expand Down
8 changes: 3 additions & 5 deletions packages/globals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@
"clean": "rm -rf dist *.tsbuildinfo",
"lint": "eslint \"{src,test}/**/*.ts\"",
"check:types": "tsc --noEmit",
"test": "mocha -r ts-node/register test/**/*.test.ts",
"test": "tsx --test --no-deprecation",
"prepack": "tsc --build ./tsconfig.build.json && yarn prepack:es2015 && yarn prepack:commonjs",
"prepack:es2015": "tsc --project ./tsconfig.build.json --outdir dist/esm --module es2015",
"prepack:commonjs": "tsc --project ./tsconfig.build.json --outdir dist/cjs --module commonjs"
},
"devDependencies": {
"@frontside/tsconfig": "^1.2.0",
"@types/jsdom": "^16.2.3",
"@types/mocha": "^7.0.1",
"@types/node": "^14.17.5",
"@types/node": "^20.11.25",
"tsx": "^4.7.1",
"expect": "^24.9.0",
"jsdom": "^16.2.2",
"mocha": "^6.2.2",
"ts-node": "^10.4.0",
"typescript": "~4.4.4"
},
"volta": {
Expand Down
2 changes: 1 addition & 1 deletion packages/globals/test/globals.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from "mocha";
import { beforeEach, describe, it } from "node:test";
import expect from "expect";
import { JSDOM } from "jsdom";
import { Symbol } from "@effection/core";
Expand Down
8 changes: 3 additions & 5 deletions packages/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"clean": "rm -rf dist *.tsbuildinfo",
"lint": "eslint \"{src,test}/**/*.ts\"",
"check:types": "tsc --noEmit",
"test": "mocha -r ts-node/register \"test/**/*.test.ts\"",
"test": "tsx --test --no-deprecation",
"docs": "rm -rf docs && yarn typedoc --options typedoc.json",
"docs:netlify": "yarn prepack && yarn docs",
"docs:preview": "yarn parcel docs/api/v1/index.html",
Expand All @@ -38,13 +38,11 @@
},
"devDependencies": {
"@frontside/tsconfig": "^1.2.0",
"@types/mocha": "^7.0.1",
"@types/node": "^14.17.5",
"@types/node": "^20.11.25",
"tsx": "^4.7.1",
"expect": "^24.9.0",
"jsdom": "^16.2.2",
"mocha": "^6.2.2",
"parcel": "^2.10.2",
"ts-node": "^10.4.0",
"typedoc": "^0.22.7",
"typescript": "~4.4.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/button.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { Button, Heading } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/check-box.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { beforeEach, describe, it } from 'node:test';
import expect from 'expect';
import { CheckBox, Heading } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/details.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { Details } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/field-set.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { FieldSet } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/heading.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { Heading } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { beforeEach } from "mocha";
import { afterEach, beforeEach } from "node:test";
import { DOMWindow, JSDOM } from "jsdom";
import { globals, setDocumentResolver, setInteractorTimeout } from "@interactors/globals";

Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/html.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { HTML } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/link.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { Link, Heading } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/multi-select.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { beforeEach, describe, it } from 'node:test';
import expect from 'expect';
import { MultiSelect, Heading } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/page.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';

import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/radio-button.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { RadioButton, Heading } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/select.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { beforeEach, describe, it } from 'node:test';
import expect from 'expect';
import { Select, Heading } from '../src/index';
import { dom } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/html/test/text-field.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import expect from 'expect';
import { TextField, Heading } from '../src/index';
import { dom } from './helpers';
Expand Down
8 changes: 3 additions & 5 deletions packages/keyboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"clean": "rm -rf dist *.tsbuildinfo",
"lint": "eslint \"{src,test}/**/*.ts\"",
"check:types": "tsc --noEmit",
"test": "mocha -r ts-node/register \"test/**/*.test.ts\"",
"test": "tsx --test --no-deprecation",
"docs": "rm -rf docs && yarn typedoc --options typedoc.json",
"docs:netlify": "yarn prepack && yarn docs",
"docs:preview": "yarn parcel docs/api/v1/index.html",
Expand All @@ -38,13 +38,11 @@
},
"devDependencies": {
"@frontside/tsconfig": "^1.2.0",
"@types/mocha": "^7.0.1",
"@types/node": "^14.17.5",
"@types/node": "^20.11.25",
"tsx": "^4.7.1",
"expect": "^24.9.0",
"jsdom": "^16.2.2",
"mocha": "^6.2.2",
"parcel": "^2.10.2",
"ts-node": "^10.4.0",
"typedoc": "^0.22.7",
"typescript": "~4.4.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/keyboard/test/fill-in.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import { globals } from '@interactors/globals';
import { createInteractor } from '@interactors/core';
import { fillIn } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion packages/keyboard/test/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { beforeEach } from "mocha";
import { afterEach, beforeEach } from "node:test";
import { DOMWindow, JSDOM } from "jsdom";
import { globals, setDocumentResolver, setInteractorTimeout } from "@interactors/globals";

Expand Down
2 changes: 1 addition & 1 deletion packages/keyboard/test/keyboard.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it } from 'mocha';
import { describe, it } from 'node:test';
import { globals, setKeyboardLayout } from '@interactors/globals';
import { createInteractor } from '@interactors/core';
import { Keyboard, createKeyboardLayout } from '../src';
Expand Down
Loading
Loading