Skip to content

Commit 15be8e6

Browse files
authored
Update dependencies (#20)
* Update prettier * Check prettier in lint script * Update typescript * Separate lint and typescript from test script * Update jsdom * Update eslint * Remove regenerator-runtime * Update cross-fetch to 4.0 * Fix npm commands in CI
1 parent b8f69c1 commit 15be8e6

File tree

8 files changed

+1281
-1807
lines changed

8 files changed

+1281
-1807
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
with:
2525
node-version: ${{ matrix.node-version }}
2626
- run: npm install
27+
- run: npm run lint
28+
- run: npm run tsc
2729
- run: npm test
28-
env:
29-
CI: true

.prettierrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ module.exports = {
22
singleQuote: true,
33
printWidth: 120,
44
proseWrap: 'always',
5+
trailingComma: 'es5',
56
};

LICENSE.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@ MIT License
22

33
Copyright (c) 2017 Jeff Lau
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
7+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
8+
persons to whom the Software is furnished to do so, subject to the following conditions:
119

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
10+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
11+
Software.
1412

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
14+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -614,13 +614,13 @@ describe('getYear action creator', () => {
614614

615615
### Using `fetch.mock` to inspect the mock state of each fetch call
616616

617-
`fetch.mock` by default uses [Vitest's mocking functions](https://vitest.dev/api/mock.html). Therefore
618-
you can make assertions on the mock state. In this example we have an arbitrary function that makes a different fetch
619-
request based on the argument you pass to it. In our test, we run Vitest's `beforeEach()` and make sure to reset our
620-
mock before each `it()` block as we will make assertions on the arguments we are passing to `fetch()`. Then we use the
621-
`fetch.requests()` function to give us a history of all non-aborted requests (normalized) that were made. It can give you
622-
information on each call, and their arguments which you can use for your `expect()` calls. Vitest also comes with some
623-
nice aliases for the most used ones.
617+
`fetch.mock` by default uses [Vitest's mocking functions](https://vitest.dev/api/mock.html). Therefore you can make
618+
assertions on the mock state. In this example we have an arbitrary function that makes a different fetch request based
619+
on the argument you pass to it. In our test, we run Vitest's `beforeEach()` and make sure to reset our mock before each
620+
`it()` block as we will make assertions on the arguments we are passing to `fetch()`. Then we use the `fetch.requests()`
621+
function to give us a history of all non-aborted requests (normalized) that were made. It can give you information on
622+
each call, and their arguments which you can use for your `expect()` calls. Vitest also comes with some nice aliases for
623+
the most used ones.
624624

625625
```js
626626
// api.js
@@ -670,7 +670,7 @@ describe('testing api', () => {
670670
APIRequest('twitter');
671671

672672
expect(fetch).toBeCalled(); // alias for expect(fetch.mock.calls.length).toEqual(1);
673-
expect(fetch.requests().map(v => v.url)).toContain('https://twitter.com/');
673+
expect(fetch.requests().map((v) => v.url)).toContain('https://twitter.com/');
674674
});
675675
});
676676
```

0 commit comments

Comments
 (0)