forked from usebruno/bruno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix/test - update Jest configuration to fix unit tests (usebruno#2672
- Loading branch information
1 parent
d2db2b0
commit 47510df
Showing
2 changed files
with
15 additions
and
22 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 |
---|---|---|
@@ -1,25 +1,15 @@ | ||
// damn jest throws an error when no tests are found in a file | ||
// --passWithNoTests doesn't work | ||
const { configureRequest } = require('../../src/ipc/network/index'); | ||
|
||
describe('dummy test', () => { | ||
it('should pass', () => { | ||
expect(true).toBe(true); | ||
describe('index: configureRequest', () => { | ||
it("Should add 'http://' to the URL if no protocol is specified", async () => { | ||
const request = { method: 'GET', url: 'test-domain', body: {} }; | ||
await configureRequest(null, request, null, null, null, null); | ||
expect(request.url).toEqual('http://test-domain'); | ||
}); | ||
}); | ||
|
||
// todo: fix this failing test | ||
// const { configureRequest } = require('../../src/ipc/network/index'); | ||
|
||
// describe('index: configureRequest', () => { | ||
// it("Should add 'http://' to the URL if no protocol is specified", async () => { | ||
// const request = { method: 'GET', url: 'test-domain', body: {} }; | ||
// await configureRequest(null, request, null, null, null, null); | ||
// expect(request.url).toEqual('http://test-domain'); | ||
// }); | ||
|
||
// it("Should NOT add 'http://' to the URL if a protocol is specified", async () => { | ||
// const request = { method: 'GET', url: 'ftp://test-domain', body: {} }; | ||
// await configureRequest(null, request, null, null, null, null); | ||
// expect(request.url).toEqual('ftp://test-domain'); | ||
// }); | ||
// }); | ||
it("Should NOT add 'http://' to the URL if a protocol is specified", async () => { | ||
const request = { method: 'GET', url: 'ftp://test-domain', body: {} }; | ||
await configureRequest(null, request, null, null, null, null); | ||
expect(request.url).toEqual('ftp://test-domain'); | ||
}); | ||
}); |