UNPKG

@apistudio/apim-cli

Version:

CLI for API Management Products

75 lines (70 loc) 2.12 kB
// import { CollectionCreator } from '../../src/newman/newman-collection.builder.js'; // import fs from 'fs'; // import * as yaml from 'js-yaml'; // jest.mock('../../src/service/log-wrapper.ts'); describe('newman collection builder', () => { it('dummy', () => { expect(1).toBeTruthy(); }) // it('creating collection if the asset has $endpoint in api spection ', async () => { // const obj = new CollectionCreator(); // const buffer = fs.readFileSync('./packages/studio-test/tests/assets/valid-asset.zip'); // const parsedobj: any = yaml.load(`kind: test // metadata: // name: TestPayments2 // version: 1.0.2 // tags: // - functional // namespace: default // spec: // api: // $endpoint: 'http://swagger.petstore.io' // environment: // $ref: default:TestPaymentsEnvironment:1.0.0 // request: // - method: POST // resource: v2/pet // headers: // - key: Content-Type // value: '' // auth: // noauth: true // payload: // raw: // json: | // { // "name":"Jose" // } // settings: // sslVerification: false // encodeURL: true // assertions: // $ref: default:TestPaymentAssertion:1.0.0 // - method: POST // resource: v2/pet // headers: // - key: Content-Type // value: '' // auth: // noauth: true // payload: // raw: // json: | // { // "name":"Adam" // } // settings: // sslVerification: false // encodeURL: true // assertions: // expressions: // - name: "Validate the response code" // key: "code" // value: 200 // action: "equals" // `); // const collection = await obj.createCollection(parsedobj, buffer); // expect(collection).not.toBeNull(); // expect(collection).not.toBeUndefined(); // }); });