@anmiles/downloader 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +5 -0
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/lib/__tests__/downloader.test.ts +8 -4
package/.eslintrc.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.0.6](../../tags/v2.0.6) - 2023-05-26
|
|
9
|
+
### Changed
|
|
10
|
+
- Re-initialize emitter instance before each test
|
|
11
|
+
|
|
12
|
+
## [2.0.5](../../tags/v2.0.5) - 2023-05-08
|
|
13
|
+
### Changed
|
|
14
|
+
- Use shared eslint config * explicitly specify ignorePatterns
|
|
15
|
+
|
|
8
16
|
## [2.0.4](../../tags/v2.0.4) - 2023-05-07
|
|
9
17
|
### Changed
|
|
10
18
|
- Cleanup cSpell words
|
package/package.json
CHANGED
|
@@ -12,10 +12,8 @@ jest.mock<Partial<typeof downloader>>('../downloader', () => ({
|
|
|
12
12
|
downloadString : jest.fn().mockImplementation((...args: Parameters<typeof original.downloadString>) => original.downloadString(...args)),
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
response.pipe = jest.fn();
|
|
18
|
-
response.resume = jest.fn();
|
|
15
|
+
let request: http.ClientRequest;
|
|
16
|
+
let response: http.IncomingMessage;
|
|
19
17
|
|
|
20
18
|
function get(url: string | URL, options: https.RequestOptions, callback?: ((res: http.IncomingMessage) => void) | undefined): http.ClientRequest {
|
|
21
19
|
if (callback) {
|
|
@@ -26,6 +24,12 @@ function get(url: string | URL, options: https.RequestOptions, callback?: ((res:
|
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
beforeEach(() => {
|
|
27
|
+
request = emitter() as typeof request;
|
|
28
|
+
response = emitter() as typeof response;
|
|
29
|
+
|
|
30
|
+
response.pipe = jest.fn();
|
|
31
|
+
response.resume = jest.fn();
|
|
32
|
+
|
|
29
33
|
response.statusCode = 200;
|
|
30
34
|
});
|
|
31
35
|
|