Skip to content

Commit a22bccd

Browse files
committed
Added second unit test to verify when setting is disabled
1 parent 1ee38df commit a22bccd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/useTempDir.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,17 @@ describe('Generation tests using system temporary directory', () => {
1818

1919
});
2020

21+
it('Do not use system temp folder when useTempDir is false', () => {
22+
23+
const optionsWithoutTempDir = { ...options };
24+
optionsWithoutTempDir.useTempDir = false;
25+
26+
const gen = new NgOpenApiGen(templatesSpec as OpenAPIObject, optionsWithoutTempDir);
27+
gen.generate();
28+
29+
const tempDirectory = os.tmpdir();
30+
expect(gen.tempDir.startsWith(tempDirectory)).toBeFalse();
31+
32+
});
33+
2134
});

0 commit comments

Comments
 (0)