• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • Frisby.js – 簡單易用的開源REST API測試框架

    發表于:2014-07-07來源:DiggerPlus作者:小A點擊數: 標簽:I測試框架
    借助node.js的魔力,我們已經看到很多優秀的web測試框架,今天給大家分享的是Frisby.js 從下面的測試示例中,我們可以看到Frisby能夠提供了很多實用的測試方法,例如expectStatus,e
    Frisby.js - 簡單易用的開源REST API測試框架

      Frisby

      借助node.js的魔力,我們已經看到很多優秀的web測試框架,今天給大家分享的是Frisby.js

      從下面的測試示例中,我們可以看到Frisby能夠提供了很多實用的測試方法,例如expectStatus,expectJSON等,來測試httpstatus,json。

      測試代碼

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    var frisby = require('frisby');
     
    frisby.create('Get Brightbit Twitter feed')
      .get('https://api.twitter.com/1/statuses/user_timeline.json?screen_name=brightbit')
      .expectStatus(200)
      .expectHeaderContains('content-type', 'application/json')
      .expectJSON('0', {
        place: function(val) { expect(val).toMatchOrBeNull("Oklahoma City, OK"); }, // Custom matcher callback
        user: {
          verified: false,
          location: "Oklahoma City, OK",
          url: "http://brightb.it"
        }
      })
      .expectJSONTypes('0', {
        id_str: String,
        retweeted: Boolean,
        in_reply_to_screen_name: function(val) { expect(val).toBeTypeOrNull(String); }, // Custom matcher callback
        user: {
          verified: Boolean,
          location: String,
          url: String
        }
      })
    .toss();

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>