create-app: fix for test not restoring cwd
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -103,6 +103,7 @@ describe('tasks', () => {
|
||||
|
||||
const mockDir = createMockDirectory();
|
||||
|
||||
const origCwd = process.cwd();
|
||||
const realChdir = process.chdir;
|
||||
// If anyone calls chdir then make it resolve within the tmpdir
|
||||
const mockChdir = jest.spyOn(process, 'chdir');
|
||||
@@ -130,6 +131,10 @@ describe('tasks', () => {
|
||||
mockChdir.mockReset();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
realChdir(origCwd);
|
||||
});
|
||||
|
||||
describe('checkAppExistsTask', () => {
|
||||
it('should do nothing if the directory does not exist', async () => {
|
||||
const dir = 'projects/';
|
||||
|
||||
Reference in New Issue
Block a user