testingrequired / restspec

Interact or test REST resources from the command line.
MIT License
0 stars 0 forks source link

Asynchronous test functions #16

Closed kyleect closed 5 years ago

kyleect commented 5 years ago
module.exports = {
  name: "Google",
  url: "https://www.google.com/",
  method: "GET",
  tests: async (response, responseTime, assert) => [
    assert(response.ok),
    assert(responseTime <= 300),
    assert(await response.json()).deepStrictEqual({key: "value"});
  ]
};
kyleect commented 5 years ago

Done