You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to have a central (common) instance of the hippieSwaggerApp() function, to make it cleaner for each of my tests to call it. As a workaround, within each Test Suite, I've duplicated the function:
importhippiefrom"hippie-swagger";import{username,password}from"common/resources/httpAuth.json";describe("Test Swagger examples for Foo",()=>{letdereferencedSwagger;functionmyApp(){returnhippie(dereferencedSwagger).base(baseUrl).auth(username,password).json();}before(async()=>{dereferencedSwagger=awaitparseSwaggerDoc(mySwaggerDoc);});context("<Foo>",()=>{it("Returns 200, when sending a valid request",async()=>{awaitmyApp().header("Auth-Type","auth").header("Auth-Token",authToken).get(`my/route/{id}`).pathParams({id: my.id,}).expectStatus(200).end();});
However, it would be really nice to have a setup script which parses the Swagger Doc (as we have multiple APIs), and writes the dereferenced contents to a temp file. Allowing for:
// tests.spec.jsimportmyHippieAppfrom"service/path/myHippieApp";describe("Test Swagger examples for Foo",()=>{context("<Foo>",()=>{it("Returns 200, when sending a valid request",async()=>{awaitmyHippieApp().header("Auth-Type","auth").header("Auth-Token",authToken).get(`my/route/{id}`).pathParams({id: my.id,}).expectStatus(200).end();});
The text was updated successfully, but these errors were encountered:
I'd like to have a central (common) instance of the
hippieSwaggerApp()
function, to make it cleaner for each of my tests to call it. As a workaround, within each Test Suite, I've duplicated the function:However, it would be really nice to have a setup script which parses the Swagger Doc (as we have multiple APIs), and writes the dereferenced contents to a temp file. Allowing for:
The text was updated successfully, but these errors were encountered: