11"use strict" ;
22
33const fs = require ( "fs" ) ;
4+ const path = require ( "path" ) ;
5+
46const PostmanGenerator = require ( "openapi-to-postmanv2" ) ;
57const sinon = require ( "sinon" ) ;
68const expect = require ( "chai" ) . expect ;
@@ -14,6 +16,7 @@ const OpenAPIGenerator = require("../../src/openAPIGenerator");
1416
1517describe ( "OpenAPIGenerator" , ( ) => {
1618 let sls , logOutput ;
19+
1720 beforeEach ( function ( ) {
1821 sls = {
1922 service : {
@@ -58,6 +61,11 @@ describe("OpenAPIGenerator", () => {
5861 } ;
5962 } ) ;
6063
64+ after ( function ( ) {
65+ delete require
66+ . cache [ require . resolve ( `${ path . resolve ( "options" ) } /redocly.json` ) ] ;
67+ } ) ;
68+
6169 describe ( "generationAndValidation" , ( ) => {
6270 it ( "should correctly generate a valid openAPI document" , async function ( ) {
6371 const succSpy = sinon . spy ( logOutput . log , "success" ) ;
@@ -168,9 +176,11 @@ describe("OpenAPIGenerator", () => {
168176 const errSpy = sinon . spy ( logOutput . log , "error" ) ;
169177
170178 Object . assign ( sls . service , basicDocumentation ) ;
179+
171180 const getAllFuncsStub = sinon
172181 . stub ( sls . service , "getAllFunctions" )
173182 . returns ( [ "createUser" ] ) ;
183+
174184 const basicInvalidFunction = JSON . parse (
175185 JSON . stringify ( basicValidFunction )
176186 ) ;
0 commit comments