Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including fastret-framework with all npm packages installed. Try it out:

var fastretFramework = require("fastret-framework")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

fastret-framework v1.0.2

Fastest rest api test suite builder

fastret-framework

Build Status

Fastest rest api test suite builder

Give us a :star: if you like our work :heart:

Install

$ npm install fastret-framework --save

Usage

const FastRet = require('fastret-framework');

const TEST_API = [
  {
    'name': 'GET API TEST',
    'url': 'https://jsonplaceholder.typicode.com/todos/1',
    'headers': {},
    'body': {},
    'method': 'GET',
    'skip_keys': ['title'],
    'response': {
      'userId': 1,
      'id': 1,
      'title': 'delectus aut aute',
      'completed': false
    }
  },
  {
    'name': 'GET API WRONG TEST',
    'url': 'https://jsonplaceholder.typicode.com/todos/2',
    'headers': {},
    'body': {},
    'method': 'GET',
    'skip_keys': ['title'],
    'response': {
      'userId': 1,
      'id': 1,
      'title': 'delectus aut aute',
      'completed': false
    }
  }
];

const fastRetSuite = new FastRet(TEST_API);

// Executes all the tests
fastRetSuite.execute();

// Output
// ✔ Passed: GET API TEST
// ✖ Failed: GET API WRONG TEST

API

execute()

Executes all the tests, shows test results in console. Also stores all the test results in results

isValid()

Validates if the input json contains all the required parameters

this.data

Contains the complete input test json

this.results

Contains all the tests results of execute() api

Data Structure
{
  "name": "NAME_OF_THE_API",
  "isPassed": "PASSED_STATUS",
  "errorMessage": "ERROR_MESSAGE" // if api failed with some error message
}

This gets updated once execute api is completed.

Contributing

Interested in contributing to this project? You can log any issues or suggestion related to this library here

Read our contributing guide on getting started with contributing to the codebase

Contributors

Thank you to all the contributors who have helped us in making this project better :raised_hands:

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free