create-app: fix for test not restoring cwd

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-10-13 11:05:52 +02:00
parent b2817daf0c
commit 29f2e76b51
@@ -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/';