Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

Commit 354ff10

Browse files
committed
Fixing tests
1 parent a9d6181 commit 354ff10

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/__tests__/DefinitionGenerator.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ class ServerlessInterface extends Serverless {
1414
describe('OpenAPI Documentation Generator', () => {
1515
let sls: ServerlessInterface;
1616

17+
const servicePath = path.join(__dirname, '../../test/project');
18+
1719
beforeEach(async () => {
18-
const servicePath = path.join(__dirname, '../../test/project');
20+
1921
const serverlessYamlPath = path.join(servicePath, './serverless.yml');
2022
sls = new Serverless();
2123

@@ -35,12 +37,12 @@ describe('OpenAPI Documentation Generator', () => {
3537
});
3638

3739
it('Generates OpenAPI document', async () => {
38-
const docGen = new DefinitionGenerator(sls.service.custom.documentation);
40+
const docGen = new DefinitionGenerator(sls.service.custom.documentation, servicePath);
3941
expect(docGen).not.toBeNull();
4042
});
4143

4244
it('adds paths to OpenAPI output from function configuration', async () => {
43-
const docGen = new DefinitionGenerator(sls.service.custom.documentation);
45+
const docGen = new DefinitionGenerator(sls.service.custom.documentation, servicePath);
4446

4547
// implementation copied from ServerlessOpenApiDocumentation.ts
4648
docGen.parse();

0 commit comments

Comments
 (0)