loading...

New Unit Testing Tool For JSON APIs. TypeScript Like Syntax.

whizsid profile image WhizSid ・1 min read

Why are you write so much codes to check your JSON REST API? JSONAPIUnit is a new unit testing tool that enable users to write test cases easily.

Normal Framework

var client = new Client();

var request = client.get("http://127.0.0.1:8000/api/user/login");

var headers = new Headers();

headers.append("Content-Type","application/json");

// blah blah blah

JSONAPIUnit

{
  "url":"http://127.0.0.1:8000/api/user/login",
  "request":{
      "username":"{{username}}",
      "password":"{{password}}"
  },
  "response":{
      "body":{
         "token":"{{token:string}}",
         "name": "{{string}}",
         "limit": "{{limit: number && limit>250 }}",
         "posts": [
             {
                "id": "{{number}}",
                "title": "{{string}}"
             }
         ]
      },
      "status":200
  }
}

This is an open source project. Read more at github

Posted on by:

whizsid profile

WhizSid

@whizsid

I am a soft ware developer and I love front end developing

Discussion

pic
Editor guide