Skip to content

refactor(run): migrate all packages from Jest to node:test#695

Draft
Copilot wants to merge 3 commits intofeat/nextfrom
copilot/rework-tests-to-use-node-test
Draft

refactor(run): migrate all packages from Jest to node:test#695
Copilot wants to merge 3 commits intofeat/nextfrom
copilot/rework-tests-to-use-node-test

Conversation

Copy link

Copilot AI commented Feb 11, 2026

Summary of changes

Removes Jest entirely from the codebase. All 133+ test files across 28+ packages now use node:test + @deepkit/run/expect. Angular/GUI packages excluded per requirements.

Test imports migration

All @jest/globals imports replaced:

// Before
import { expect, test, describe, beforeEach } from '@jest/globals';

// After
import { test, describe, beforeEach } from 'node:test';
import { expect } from '@deepkit/run/expect';

@deepkit/run/expect additions

  • spyOn(obj, method) — lightweight jest.spyOn replacement
  • expect.any(), expect.anything(), expect.arrayContaining(), expect.objectContaining(), expect.stringContaining() — asymmetric matchers
  • toHaveBeenCalled(), toHaveBeenCalledWith() — mock call assertions
  • .rejects / .resolves — async promise matchers

@deepkit/run loader

  • .tsx file support in ESM hooks and CJS extension handlers

Jest API refactors

  • jest.fn()fn(), jest.spyOn()spyOn()
  • jest.mock() in application-server.spec.ts removed (tests restructured)
  • beforeAll/afterAllbefore/after (node:test naming)

Removed

  • jest-resolver.js, jest-serial-runner.js, packages/type/tests/jest-setup.ts
  • jest config from all package.json files
  • jest, ts-jest, @jest/globals from root devDependencies

Added

  • test:node script in every package with tests
  • scripts/run-tests.js — runs test:node across all packages

Verified passing: bson (561), type (1983), core (339), injector (129), topsort (21), event (15), workflow (6), stopwatch (2), logger (12), skeleton (1).

Relinquishment of Rights

Please mark following checkbox to confirm that you relinquish all rights of your changes:

  • I waive and relinquish all rights regarding this changes (including code, text, and images) to Deepkit UG (limited), Germany. This changes (including code, text, and images) are under MIT license without name attribution, copyright notice, and permission notice requirement.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 11, 2026 09:18
- Replace @jest/globals imports with node:test + @deepkit/run/expect
- Add test:node script to all package.json files
- Remove jest config from all package.json files
- Add spyOn, expect.any, expect.anything, expect.arrayContaining,
  expect.objectContaining, expect.stringContaining to @deepkit/run/expect
- Add .tsx file support to @deepkit/run hooks
- Refactor jest.mock/jest.spyOn usage in framework and http tests
- Remove jest dependencies from root package.json
- Add scripts/run-tests.js for running all package tests

Co-authored-by: marcj <450980+marcj@users.noreply.github.com>
Co-authored-by: marcj <450980+marcj@users.noreply.github.com>
Copilot AI changed the title [WIP] Rework all package tests to use node:test and remove jest refactor(run): migrate all packages from Jest to node:test Feb 11, 2026
Copilot AI requested a review from marcj February 11, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants