-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support remote types served by https (#8)
Co-authored-by: denis-heka <44803580+denis-heka@users.noreply.github.com> close issue #7
- Loading branch information
Showing
4 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"userId": 1, | ||
"id": 1, | ||
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", | ||
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { downloadFile } from '../index' | ||
import path from 'path' | ||
|
||
describe('download file', () => { | ||
test('can download https files', async () => { | ||
const isSuccess = await downloadFile('https://jsonplaceholder.typicode.com/posts/1', path.resolve('src/__test__', 'downloadSpecHelper.json')) | ||
expect(isSuccess).toBe(true); | ||
}); | ||
test('can download http files', async () => { | ||
const isSuccess = await downloadFile('http://jsonplaceholder.typicode.com/posts/1', path.resolve('src/__test__', 'downloadSpecHelper.json')) | ||
expect(isSuccess).toBe(true); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters