mattermost/webapp/platform/client/setup_jest.ts
Harrison Healey c89450e2cf
Update to Jest 30 (#34011)
* Unify version of Jest in subpackages

* Upgrade @types/jest

* Update jest and jest-watch-typeahead

* Add nock and node-fetch to client package

* Update snapshots for new version of Jest

* Replace renamed test assertions

* Update more snapshots

* Update type definitions to fix dependency install issues

* Re-add --coverage to CI tests

* Revert "Re-add --coverage to CI tests"

This reverts commit b59a66eb09.

* Update snapshots in components package

* Remove nock.disableNetConnect from Client4 tests

* Standardize how we mock fetch in different test environments

* Add --forceExit and --verbose to test-ci

* Try --no-watchAll?
2025-11-12 18:05:50 +00:00

8 lines
358 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import nodeFetch from 'node-fetch';
// Nock 13 can't mock Node's built-in fetch, so we have to replace the it with node-fetch to be able to mock it despite
// some mismatched parameters.
globalThis.fetch = nodeFetch as unknown as typeof fetch;