Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
# by the Jest partition.
FK_ENV_NODEJS: ${{ matrix.node }}
run: |
npm run test:unit:vitest -- \
npm run test:unit:vitest:shuffled -- \
--shard="$SHARD" \
--passWithNoTests

Expand Down
44 changes: 0 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
"test:unit": "npm run --workspace @wordpress/unit-tests test:unit --",
"test:unit:conventions": "npm run --workspace @wordpress/unit-tests test:unit:conventions",
"test:unit:vitest": "npm run --workspace @wordpress/unit-tests test:unit:vitest --",
"test:unit:vitest:shuffled": "npm run --workspace @wordpress/unit-tests test:unit:vitest:shuffled --",
"test:unit:vitest:update": "npm run --workspace @wordpress/unit-tests test:unit:vitest:update --",
"test:unit:vitest:watch": "npm run --workspace @wordpress/unit-tests test:unit:vitest:watch --",
"test:unit:routing": "npm run --workspace @wordpress/unit-tests test:unit:routing --",
Expand Down
2 changes: 1 addition & 1 deletion packages/a11y/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* With typeRoots set in tsconfig, global types outside those directories,
* like the jest-dom matchers, must be referenced explicitly.
*/
import '@testing-library/jest-dom';
import '@testing-library/jest-dom/vitest';
1 change: 0 additions & 1 deletion packages/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
},
"devDependencies": {
"@testing-library/jest-dom": "^6.9.1",
"@types/jest": "^30.0.0",
"vitest": "^4.1.10"
},
"publishConfig": {
Expand Down
1 change: 1 addition & 0 deletions packages/a11y/src/script/test/add-container.jsdom.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from 'vitest';
import addContainer from '../add-container';

describe( 'addContainer', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/a11y/src/shared/test/clear.jsdom.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from 'vitest';
import clear from '../clear';

describe( 'clear', () => {
Expand Down
28 changes: 15 additions & 13 deletions packages/a11y/src/test/index.jsdom.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import domReady from '@wordpress/dom-ready';
import { setup, speak } from '../';
import clear from '../shared/clear';
import filterMessage from '../shared/filter-message';

jest.mock( '../shared/clear', () => {
return jest.fn();
} );
jest.mock( '@wordpress/dom-ready', () => {
return jest.fn( ( callback: () => void ) => {
vi.mock( import( '../shared/clear' ), () => ( {
default: vi.fn(),
} ) );
vi.mock( import( '@wordpress/dom-ready' ), () => ( {
default: vi.fn( ( callback: VoidFunction ) => {
callback();
} );
} );
jest.mock( '../shared/filter-message', () => {
return jest.fn( ( message: string ) => {
return message;
} );
} );
return undefined;
} ),
} ) );
vi.mock( import( '../shared/filter-message' ), () => ( {
default: vi.fn( ( message: string ) => message ),
} ) );

const domReadyCalledOnImport = vi.mocked( domReady ).mock.calls.length > 0;

describe( 'speak', () => {
let containerPolite = document.getElementById( 'a11y-speak-polite' );
Expand All @@ -28,7 +30,7 @@ describe( 'speak', () => {

describe( 'on import', () => {
it( 'should call domReady', () => {
expect( domReady ).toHaveBeenCalled();
expect( domReadyCalledOnImport ).toBe( true );
} );
} );

Expand Down
1 change: 0 additions & 1 deletion packages/abilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"ajv-formats": "^3.0.1"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"vitest": "^4.1.10"
},
"publishConfig": {
Expand Down
Loading
Loading