switch from Jest to Vitest
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -14,17 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {jest} from '@jest/globals';
|
||||
import {vi} from 'vitest';
|
||||
import os from 'os';
|
||||
|
||||
export const mockPlatform = (platform: NodeJS.Platform) => {
|
||||
return jest.spyOn(os, 'platform').mockImplementation(() => platform);
|
||||
return vi.spyOn(os, 'platform').mockImplementation(() => platform);
|
||||
};
|
||||
|
||||
export const mockArch = (arch: string) => {
|
||||
return jest.spyOn(os, 'arch').mockImplementation(() => arch);
|
||||
return vi.spyOn(os, 'arch').mockImplementation(() => arch);
|
||||
};
|
||||
|
||||
export const mockHomedir = (dir: string) => {
|
||||
return jest.spyOn(os, 'homedir').mockImplementation(() => dir);
|
||||
return vi.spyOn(os, 'homedir').mockImplementation(() => dir);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user