-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetch-mock upgrade to 10.1.0 version #208702
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ | |
*/ | ||
|
||
import { convertItemsMock } from './driver.test.mocks'; | ||
// @ts-expect-error | ||
import fetchMock from 'fetch-mock/es5/client'; | ||
|
||
import fetchMock from 'fetch-mock'; | ||
import { take } from 'rxjs'; | ||
import { NewsfeedApiDriver } from './driver'; | ||
import { storageMock } from './storage.mock'; | ||
|
@@ -67,9 +67,12 @@ describe('NewsfeedApiDriver', () => { | |
.toPromise(); | ||
|
||
expect(fetchMock.lastUrl()).toEqual('http://newsfeed.com/8.0.0/news'); | ||
expect(fetchMock.lastOptions()).toEqual({ | ||
method: 'GET', | ||
}); | ||
expect(fetchMock.lastOptions()).toMatchInlineSnapshot(` | ||
Object { | ||
"body": Promise {}, | ||
"method": "GET", | ||
} | ||
`); | ||
Comment on lines
+70
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively, something like this works as well, if we want to avoid snapshots. However, I don't think it matters much in this case. |
||
}); | ||
|
||
it('calls `convertItems` with the correct parameters', async () => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14252,15 +14252,6 @@ babel-plugin-transform-typescript-metadata@^0.3.2: | |
dependencies: | ||
"@babel/helper-plugin-utils" "^7.0.0" | ||
|
||
babel-polyfill@^6.26.0: | ||
version "6.26.0" | ||
resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" | ||
integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= | ||
dependencies: | ||
babel-runtime "^6.26.0" | ||
core-js "^2.5.0" | ||
regenerator-runtime "^0.10.5" | ||
|
||
babel-preset-current-node-syntax@^1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.0.tgz#cf5feef29551253471cfa82fc8e0f5063df07a77" | ||
|
@@ -14287,7 +14278,7 @@ babel-preset-jest@^29.6.3: | |
babel-plugin-jest-hoist "^29.6.3" | ||
babel-preset-current-node-syntax "^1.0.0" | ||
|
||
[email protected], babel-runtime@^6.26.0: | ||
[email protected]: | ||
version "6.26.0" | ||
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" | ||
integrity sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g== | ||
|
@@ -16001,7 +15992,7 @@ core-js-pure@^3.8.1: | |
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.26.0.tgz#7ad8a5dd7d910756f3124374b50026e23265ca9a" | ||
integrity sha512-LiN6fylpVBVwT8twhhluD9TzXmZQQsr2I2eIKtWNbZI1XMfBT7CV18itaN6RA7EtQd/SDdRx/wzvAShX2HvhQA== | ||
|
||
core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.9: | ||
core-js@^2.4.0: | ||
version "2.6.9" | ||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" | ||
integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== | ||
|
@@ -19086,16 +19077,16 @@ fetch-blob@^3.1.2, fetch-blob@^3.1.4: | |
node-domexception "^1.0.0" | ||
web-streams-polyfill "^3.0.3" | ||
|
||
fetch-mock@^7.3.9: | ||
version "7.3.9" | ||
resolved "https://registry.yarnpkg.com/fetch-mock/-/fetch-mock-7.3.9.tgz#a80fd2a1728f72e0634ef7a9734bc61200096487" | ||
integrity sha512-PgsTbiQBNapFz2P2UwDl3gowK3nZqfV4HdyDZ1dI4eTGGH9MLAeBglIPbyDbbNQoGYBOfla6/9uaiq7az2z4Aw== | ||
fetch-mock@^10.1.0: | ||
version "10.1.0" | ||
resolved "https://registry.yarnpkg.com/fetch-mock/-/fetch-mock-10.1.0.tgz#b2cabb4f587eca747e395e97de28c62364f301fc" | ||
integrity sha512-/2DFdUrn2afOifgXuq3ppTGOg/S8YAvjeEOlBJ4QgWiT24pYGozju3Hz5UQm1ynumY9hlzBHE2z0jd0PHD+fRg== | ||
dependencies: | ||
babel-polyfill "^6.26.0" | ||
core-js "^2.6.9" | ||
glob-to-regexp "^0.4.0" | ||
path-to-regexp "^2.2.1" | ||
whatwg-url "^6.5.0" | ||
debug "^4.1.1" | ||
dequal "^2.0.3" | ||
globrex "^0.1.2" | ||
is-subset "^0.1.1" | ||
regexparam "^3.0.0" | ||
|
||
fetch-retry@^5.0.2: | ||
version "5.0.3" | ||
|
@@ -19961,7 +19952,7 @@ glob-to-regexp@^0.3.0: | |
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" | ||
integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= | ||
|
||
glob-to-regexp@^0.4.0, glob-to-regexp@^0.4.1: | ||
glob-to-regexp@^0.4.1: | ||
version "0.4.1" | ||
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" | ||
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== | ||
|
@@ -20140,6 +20131,11 @@ globjoin@^0.1.4: | |
resolved "https://registry.yarnpkg.com/globjoin/-/globjoin-0.1.4.tgz#2f4494ac8919e3767c5cbb691e9f463324285d43" | ||
integrity sha1-L0SUrIkZ43Z8XLtpHp9GMyQoXUM= | ||
|
||
globrex@^0.1.2: | ||
version "0.1.2" | ||
resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098" | ||
integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg== | ||
|
||
gonzales-pe@^4.3.0: | ||
version "4.3.0" | ||
resolved "https://registry.yarnpkg.com/gonzales-pe/-/gonzales-pe-4.3.0.tgz#fe9dec5f3c557eead09ff868c65826be54d067b3" | ||
|
@@ -26172,11 +26168,6 @@ path-to-regexp@^1.7.0: | |
dependencies: | ||
isarray "0.0.1" | ||
|
||
path-to-regexp@^2.2.1: | ||
version "2.4.0" | ||
resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.4.0.tgz" | ||
integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w== | ||
|
||
path-to-regexp@^6.3.0: | ||
version "6.3.0" | ||
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.3.0.tgz#2b6a26a337737a8e1416f9272ed0766b1c0389f4" | ||
|
@@ -28287,11 +28278,6 @@ regenerate@^1.4.0, regenerate@^1.4.2: | |
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" | ||
integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== | ||
|
||
regenerator-runtime@^0.10.5: | ||
version "0.10.5" | ||
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" | ||
integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= | ||
|
||
regenerator-runtime@^0.11.0: | ||
version "0.11.1" | ||
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" | ||
|
@@ -28337,6 +28323,11 @@ regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.4.3, regexp.prototype.f | |
es-errors "^1.3.0" | ||
set-function-name "^2.0.1" | ||
|
||
regexparam@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-3.0.0.tgz#1673e09d41cb7fd41eaafd4040a6aa90daa0a21a" | ||
integrity sha512-RSYAtP31mvYLkAHrOlh25pCNQ5hWnT106VukGaaFfuJrZFkGRX5GhUAdPqpSDXxOhA2c4akmRuplv1mRqnBn6Q== | ||
|
||
regexpp@^3.0.0: | ||
version "3.2.0" | ||
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" | ||
|
@@ -33287,15 +33278,6 @@ whatwg-url@^5.0.0: | |
tr46 "~0.0.3" | ||
webidl-conversions "^3.0.0" | ||
|
||
whatwg-url@^6.5.0: | ||
version "6.5.0" | ||
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" | ||
integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== | ||
dependencies: | ||
lodash.sortby "^4.7.0" | ||
tr46 "^1.0.1" | ||
webidl-conversions "^4.0.2" | ||
|
||
whatwg-url@^7.0.0: | ||
version "7.0.0" | ||
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Is there a reason to use the non-null operator here (and below) instead of just optional chaining?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It already head
lastCall!.request
so I decided not to mix/change it, but I'm okay to change it as well