mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 07:53:34 +01:00
bugfix/test - update Jest configuration to fix unit tests (#2672)
This commit is contained in:
parent
f2ba351f0d
commit
6fe96a8194
@ -18,6 +18,9 @@
|
|||||||
"pack": "electron-builder --dir",
|
"pack": "electron-builder --dir",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
|
"jest": {
|
||||||
|
"modulePaths": ["node_modules"]
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/credential-providers": "3.525.0",
|
"@aws-sdk/credential-providers": "3.525.0",
|
||||||
"@usebruno/common": "0.1.0",
|
"@usebruno/common": "0.1.0",
|
||||||
|
@ -1,25 +1,15 @@
|
|||||||
// damn jest throws an error when no tests are found in a file
|
const { configureRequest } = require('../../src/ipc/network/index');
|
||||||
// --passWithNoTests doesn't work
|
|
||||||
|
|
||||||
describe('dummy test', () => {
|
describe('index: configureRequest', () => {
|
||||||
it('should pass', () => {
|
it("Should add 'http://' to the URL if no protocol is specified", async () => {
|
||||||
expect(true).toBe(true);
|
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');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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');
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
Loading…
Reference in New Issue
Block a user