api easy test


SUBMITTED BY: rickystewart3

DATE: Sept. 21, 2015, 1:17 p.m.

FORMAT: Text only

SIZE: 1.3 kB

HITS: 632

  1. var APIeasy = require('api-easy');
  2. var assert = require('chai').assert;
  3. var suite = APIeasy.describe('packages');
  4. suite.discuss('packages version 1.0')
  5. .use('212.100.229.176', 9000)
  6. .get('/1.0/packages', 'context=nl&connectorCode=3&start=1&end=1')
  7. .expect(200)
  8. .expect('expect _version on the first level', function (err, res, body) {
  9. var json = JSON.parse(body);
  10. assert.property(JSON.parse(body), '_version', 'falta _version');
  11. })
  12. .expect('expect _links on the first level', function (err, res, body) {
  13. assert.property(JSON.parse(body), '_links', 'falta _links');
  14. })
  15. .expect('expect stats on the first level', function (err, ress, body) {
  16. assert.property(JSON.parse(body), 'stats', '');
  17. })
  18. .expect('expect _embedded on the first level', function (err, ress, body) {
  19. assert.property(JSON.parse(body), '_embedded', '');
  20. })
  21. .expect('expect _connectorCode on the first level', function (err, ress, body) {
  22. assert.property(JSON.parse(body), '_conectorCode', '');
  23. })
  24. .export(module);

comments powered by Disqus