|
1 |
| -// damn jest throws an error when no tests are found in a file |
2 |
| -// --passWithNoTests doesn't work |
| 1 | +const { configureRequest } = require('../../src/ipc/network/index'); |
3 | 2 |
|
4 |
| -describe('dummy test', () => { |
5 |
| - it('should pass', () => { |
6 |
| - expect(true).toBe(true); |
| 3 | +describe('index: configureRequest', () => { |
| 4 | + it("Should add 'http://' to the URL if no protocol is specified", async () => { |
| 5 | + const request = { method: 'GET', url: 'test-domain', body: {} }; |
| 6 | + await configureRequest(null, request, null, null, null, null); |
| 7 | + expect(request.url).toEqual('http://test-domain'); |
7 | 8 | });
|
8 |
| -}); |
9 |
| - |
10 |
| -// todo: fix this failing test |
11 |
| -// const { configureRequest } = require('../../src/ipc/network/index'); |
12 |
| - |
13 |
| -// describe('index: configureRequest', () => { |
14 |
| -// it("Should add 'http://' to the URL if no protocol is specified", async () => { |
15 |
| -// const request = { method: 'GET', url: 'test-domain', body: {} }; |
16 |
| -// await configureRequest(null, request, null, null, null, null); |
17 |
| -// expect(request.url).toEqual('http://test-domain'); |
18 |
| -// }); |
19 | 9 |
|
20 |
| -// it("Should NOT add 'http://' to the URL if a protocol is specified", async () => { |
21 |
| -// const request = { method: 'GET', url: 'ftp://test-domain', body: {} }; |
22 |
| -// await configureRequest(null, request, null, null, null, null); |
23 |
| -// expect(request.url).toEqual('ftp://test-domain'); |
24 |
| -// }); |
25 |
| -// }); |
| 10 | + it("Should NOT add 'http://' to the URL if a protocol is specified", async () => { |
| 11 | + const request = { method: 'GET', url: 'ftp://test-domain', body: {} }; |
| 12 | + await configureRequest(null, request, null, null, null, null); |
| 13 | + expect(request.url).toEqual('ftp://test-domain'); |
| 14 | + }); |
| 15 | +}); |
0 commit comments