Skip to content

Commit 8e717d9

Browse files
author
Zakhar Dolozhevskiy
committed
fix: mock templates folder in test env ( we need to mimic templates structure as we have it in dist folder )
1 parent 190377a commit 8e717d9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/index.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import * as fse from 'fs-extra';
22
import * as path from 'path';
33
import * as OpenAPI from './index';
44

5-
describe('index', () => {
6-
beforeAll(() =>
7-
fse.symlinkSync(path.resolve(__dirname, 'templates'), path.resolve(__dirname, 'utils/templates'), 'dir')
8-
);
5+
beforeAll(() => {
6+
fse.symlinkSync(path.resolve(__dirname, 'templates'), path.resolve(__dirname, 'utils/templates'), 'dir');
7+
});
98

10-
afterAll(() => fse.unlinkSync(path.resolve(__dirname, 'utils/templates')));
9+
afterAll(() => {
10+
fse.unlinkSync(path.resolve(__dirname, 'utils/templates'));
11+
});
1112

13+
describe('index', () => {
1214
it('parses v2 without issues', async () => {
1315
await OpenAPI.generate({
1416
input: './test/spec/v2.json',

0 commit comments

Comments
 (0)