-
#2642
db05ac6d1
Thanks @BPScott! - Replacelolex
with using Jest's built-in clock mocking, available since Jest 26. Internally Jest uses@sinon/fake-timers
which is the API-compatible successor tololex
.As of Jest 26, the functionality of the Clock and Timer mocks are built into Jest. We recommend replacing usage of these mocks with calling jest directly:
- Replace
clock.mock()
andtimer.mock()
withjest.useFakeTimers()
- Replace
clock.restore()
andtimer.restore()
withjest.useRealTimers()
- Replace
clock.tick(time)
withjest.advanceTimersByTime(time)
- Replace
clock.setTime(time)
withjest.setSystemTime(time)
- Replace
timer.runAllTimers()
withjest.runAllTimers()
- Replace
timer.runTimersToTime()
withjest.advanceTimersByTime()
You may encounter problems if you try to use the Clock and Timer mocks in the same file. We suggest migrating away from both of them, and replacing them with Jest's own mocking behaviour.
- Replace
- #2619
d1b6a3c02
Thanks @bryanparadis! - Addkeys
function to Storage mock
-
#2608
ba4da84d5
Thanks @BPScott! - Useimport type
everywhere that we deal with importing types -
Updated dependencies [
ba4da84d5
]:- @shopify/[email protected]
-
#2593
2f731db68
Thanks @BPScott! - Remove unneededvoid 0
class property initializations -
#2595
93ec0a0e5
Thanks @BPScott! - Useimport type
when importing types -
Updated dependencies [
93ec0a0e5
]:- @shopify/[email protected]
- #2409
0bff6fad7
Thanks @BPScott! - Update types to account changes in TypeScript 4.8 and 4.9. Propogate contstraints on generic types and update type usage relating toWindow
andNavigator
. Technically this makes some types stricter, as attempting to passnull|undefined
into certain functions is now disallowed by TypeScript, but these were never expected runtime values in the first place.
- #2408
2094cb39a
Thanks @BPScott! - Update typing of Connection mock so it includesaddEventListener
,removeEventListener
,dispatchEvent
andtype
-
#2389
03c1abc8c
Thanks @BPScott! - Add types field to package.json export maps to support typescript consumers that usemoduleResolution: "node16"
-
Updated dependencies [
03c1abc8c
]:- @shopify/[email protected]
- Drop support for node 12 and Safari 10, 11 and 12. Remove wildcard export in exports field. [#2277]
- Correct wildcard export to
./*
[#2209]
- No updates. Transitive dependency bump.
- Use
./*
instead of./
in package.json exports to fix deprecation warning. [#2184]
- Rerelease after failed publish. No code changes.
- Added
length
prop to storage mock [#2107]
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- Fixed babel helpers file being generated with incorrect filename in esm build. [#2082]
- Migrate from
sewing-kit-next
toloom
for building - package build output remains identical. [#2039]
- Added file exclusion for tests to package.json and enable type checking for tests. [#2005]
- Rename test/ to tests/ [#2005]
- Updated build tooling, types are now compiled with TypeScript 4.3. [#1997]
- Ensure
tsconfig.tsbuildinfo
file is not uploaded to the npm registry. [#1982]
- Update to latest sewing-kit-next for build. Update
types
/typesVersions
fields to point directly into the build folder [#1980]
- Dimension mocks no longer leak invalid values into other tests after being restored. [#1961]
- Update minimum supported node version to 12.14.0. Add engines field to help enforce usage of this version. #1906
- Removed dependency on tslib, as we no-longer compile with
tsc
. #1829
- Updated match-media mock so it passes TypeScript's "strictPropertyInitialization" checks. #1814
- Updated multi-build outputs to include mandatory extensions to fix "Module not found" issues reported by ESM supported bundlers #1759
- Add new build outputs (CommonJS, ESM, esnext, Node) for greater tree-shakability [#1698](Shopify/quilt#1698
- Updated
fetch-mock
dependency to^9.11.0
. #1691
- Fixed broken
location
module and re-enabled tests #1684
- Updated
tslib
dependency to^1.14.1
. #1657
-
fetch-mock
is updated to the latest version #1510Please see the migration guide for more information.
- Fixed setup instructions instructions for
ensureMocksReset
- Added mock for
innerWidth
to dimensions (#1399)
- Added the
Connection
class for to allow mockingnavigator.connection
in tests #1083
- Fixed bad default behaviour when specifying only a subset of an
IntersectionObserver
mock (#762)
- Accurate return types for
Storage
mocks
- Now correctly declares a dependency on
@shopify/react-async
- Added a mock for dimensions (#625)
- Added a mock for
Promise
(#614)
- Added a mock for
IntersectionObserver
andrequestIdleCallback
(#576)
- User timing mocks #468.
- Start of Changelog