config-loader: restore cwd after tests

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-10-06 12:46:55 +02:00
parent fef854a7b5
commit 2929f856cf
2 changed files with 12 additions and 0 deletions
@@ -18,6 +18,12 @@ import { createMockDirectory } from '@backstage/backend-test-utils';
import { collectConfigSchemas } from './collect';
import path from 'path';
// cwd must be restored
const origDir = process.cwd();
afterAll(() => {
process.chdir(origDir);
});
const mockSchema = {
type: 'object',
properties: {
@@ -17,6 +17,12 @@
import { createMockDirectory } from '@backstage/backend-test-utils';
import { loadConfigSchema } from './load';
// cwd must be restored
const origDir = process.cwd();
afterAll(() => {
process.chdir(origDir);
});
describe('loadConfigSchema', () => {
const mockDir = createMockDirectory();