Skip to content

Migrate unit tests from Sinon to node:test mock API#922

Merged
devpow112 merged 1 commit into
mainfrom
depowell/unit-tests-node-mock
Jun 23, 2026
Merged

Migrate unit tests from Sinon to node:test mock API#922
devpow112 merged 1 commit into
mainfrom
depowell/unit-tests-node-mock

Conversation

@devpow112

@devpow112 devpow112 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Replaces Sinon (createSandbox, stub, spy, match, useFakeTimers) in the unit tests with the native node:test mock API (mock.method, mock.fn, mock.timers), and swaps the github.test.js process.env stub for a direct env snapshot/restore helper. sinon remains a dependency since the integration fixtures still use it.

Helps reduce dependencies but we can't get rid of mocha since I need to test it.

https://desire2learn.atlassian.net/browse/QE-2218

@github-actions github-actions Bot added the javascript Pull requests that update JavaScript code label Jun 23, 2026
@devpow112 devpow112 added the enhancement New feature or request label Jun 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Report

Report Validation

jest 🟢

Schema: PASSED 🟢
Contents: PASSED 🟢

Report

mocha 🟢

Schema: PASSED 🟢
Contents: PASSED 🟢

Report

node 🟢

Schema: PASSED 🟢
Contents: PASSED 🟢

Report

playwright 🟢

Schema: PASSED 🟢
Contents: PASSED 🟢

Report

@web/test-runner 🟢

Schema: PASSED 🟢
Contents: PASSED 🟢

Report

webdriverio 🟢

Schema: PASSED 🟢
Contents: PASSED 🟢

Report

@devpow112 devpow112 marked this pull request as ready for review June 23, 2026 19:40
@devpow112 devpow112 requested a review from a team as a code owner June 23, 2026 19:40
@devpow112 devpow112 enabled auto-merge (squash) June 23, 2026 19:40
@devpow112 devpow112 merged commit 61ade9a into main Jun 23, 2026
5 checks passed
@devpow112 devpow112 deleted the depowell/unit-tests-node-mock branch June 23, 2026 20:15
@d2l-github-release-tokens

Copy link
Copy Markdown

🎉 This PR is included in version 6.3.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@d2l-github-release-tokens d2l-github-release-tokens Bot added the released Pull requests that have been released label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request javascript Pull requests that update JavaScript code released Pull requests that have been released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants