Skip to content

Commit 6fe96a8

Browse files
authored
bugfix/test - update Jest configuration to fix unit tests (#2672)
1 parent f2ba351 commit 6fe96a8

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

packages/bruno-electron/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"pack": "electron-builder --dir",
1919
"test": "jest"
2020
},
21+
"jest": {
22+
"modulePaths": ["node_modules"]
23+
},
2124
"dependencies": {
2225
"@aws-sdk/credential-providers": "3.525.0",
2326
"@usebruno/common": "0.1.0",
Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
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');
32

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');
78
});
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-
// });
199

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

Comments
 (0)