Hide mock implementation

This commit is contained in:
panticmilos 2022-07-18 16:00:00 +02:00
parent 116ddb08f5
commit a743c858bf

View file

@ -114,18 +114,17 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
dependencyFile
);
computeKeysSpy.mockImplementation(() => Promise.resolve('Ubuntu-20.4'));
if (process.env['RUNNER_OS']?.toLowerCase() === 'linux') {
computeKeysSpy.mockImplementation(() => Promise.resolve('Ubuntu-20.4'));
Object.defineProperty(utils, 'IS_LINUX', {
value: () => {
jest.fn().mockReturnValue(true);
jest.fn().mockImplementation(() => true);
}
});
} else {
Object.defineProperty(utils, 'IS_LINUX', {
value: () => {
jest.fn().mockReturnValue(false);
jest.fn().mockReturnValue(() => false);
}
});
}