mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
21 lines
456 B
TypeScript
21 lines
456 B
TypeScript
// we are mocking the cwd for the tests, since webpack needs absolute paths
|
|
// and we don't want them in tests
|
|
process.cwd = () => '__jest__';
|
|
|
|
// a virtual mock for package.json
|
|
jest.mock(
|
|
'__jest__/package.json',
|
|
() => ({
|
|
main: 'src/app.js',
|
|
}),
|
|
{ virtual: true }
|
|
);
|
|
|
|
jest.mock('path', () => ({
|
|
...jest.requireActual('path'),
|
|
// we are mocking resolve to just simply join the paths for tests
|
|
resolve(...args) {
|
|
return args.join('/');
|
|
},
|
|
}));
|