Skip to content

Commit

Permalink
Improve formatting. Add note on fix in [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Sep 13, 2024
1 parent a5b03db commit 968f403
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions docs/guides/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ breadcrumb: migrating

## Sinon 19

### All timers are stubbed by default

A breaking change is that Fake Timers 13 now fake all timers by default. Previously
Node's `nextTick()` and `Window#queueMicroTask()` were explicitly skipped, which
was quite confusing to some. This typically might affect `async` tests where
Expand All @@ -17,15 +19,19 @@ in asynchronous tests that stopped resolving in Sinon 19.
_If you want the old behavior, specify the timers you want to fake in the `toFake`
option and leave out the name of the timers giving you trouble_.

### New implementation of the fake Date class

The new version of fake-timers also no longer creating dates using the original Date
class, but a _subclass_ (proxy). This should not matter unless you are doing some kind
of identity checks on the constructor: functionally they are the same, but if you
creating Date objects before installing the fake timers, `instanceof` checks
will not pass ([fake-timers#504](https://github.com/sinonjs/fake-timers/issues/504)).

Removal of `legacyRoutes` option that was enabled in a previous `nise` version as the
underlying library, `path-to-regexp`, had a fundamental change to its parsing that
made the option a no-op.
class, but a _subclass_ (proxy). This should not matter _unless_ you are doing some kind
of identity checks on the constructor: functionally they are the same.
See ([fake-timers#504](https://github.com/sinonjs/fake-timers/issues/504)) for an
example (which we ended up pushing a small fix for to make `instanceof` work as before).

### Removal of `useFakeServer({legacyRoutes: true})`

The `legacyRoutes` option that was enabled in a previous version has been removed.
An underlying library, `path-to-regexp`, had a fundamental change to its parsing that
made the option a no-op. This should not affect most users of Sinon.

## Sinon 18

Expand Down

0 comments on commit 968f403

Please sign in to comment.