npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

fastret-framework

1.0.2 • Public • Published

fastret-framework

Build Status

Fastest rest api test suite builder

Give us a ⭐️ if you like our work ❤️

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 🙌

install

npm i fastret-framework

Downloadsweekly downloads

4

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability