chore: fix tests

This commit is contained in:
Igor Randjelovic
2021-03-31 21:33:30 +02:00
parent a7771cc8ab
commit de13357a09
3 changed files with 23 additions and 16 deletions

View File

@ -13,6 +13,12 @@ jest.mock('cosmiconfig', () => ({
},
}));
jest.mock('../src/helpers/config.ts', () => ({
getValue(key, defaultValue) {
return defaultValue;
},
}));
jest.mock('os', () => {
const os = jest.requireActual('os');
@ -23,27 +29,27 @@ jest.mock('os', () => {
in0: [
{
address: '127.0.0.1',
family: 'IPv4'
family: 'IPv4',
},
{
address: 'in0-ipv6-should-not-use',
family: 'IPv6'
}
family: 'IPv6',
},
],
in1: [
{
address: '192.168.0.10',
family: 'IPv4'
family: 'IPv4',
},
{
address: 'in1-ipv6-should-not-use',
family: 'IPv6'
}
]
}
}
}
})
family: 'IPv6',
},
],
};
},
};
});
jest.mock('path', () => {
const path = jest.requireActual('path');