How to use traverson - 10 common examples

To help you get started, we’ve selected a few traverson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github traverson / traverson-hal / test / localhost.js View on Github external
after(function() {
    if (isNodeJs() && testServer) {
      testServer.stop();
    }
    // de-register HAL plug-in to leave Traverson in a clean state for other
    // tests
    traverson.registerMediaType(JsonHalAdapter.mediaType, null);
  });
github traverson / traverson-hal / test / json_hal.js View on Github external
after(function() {
    // de-register HAL plug-in to leave Traverson in a clean state for other
    // tests
    traverson.registerMediaType(JsonHalAdapter.mediaType, null);
  });
github traverson / traverson-hal / test / content_negotiation.js View on Github external
after(function() {
    // de-register HAL plug-in to leave Traverson in a clean state for other
    // tests
    traverson.registerMediaType(JsonHalAdapter.mediaType, null);
  });
github traverson / traverson-hal / test / content_negotiation.js View on Github external
describe('Content negotiation', function() {

  var api
    , callback
    , firstUri
    , get
    , mockResponse
    , rootResponse
    , rootUri = 'http://api.io'
    , client = traverson.from(rootUri)
    , secondResponse
    , secondUri
    , thirdResponse;

  before(function() {
    traverson.registerMediaType(JsonHalAdapter.mediaType, JsonHalAdapter);
  });

  after(function() {
    // de-register HAL plug-in to leave Traverson in a clean state for other
    // tests
    traverson.registerMediaType(JsonHalAdapter.mediaType, null);
  });

  beforeEach(function() {
    api = client.newRequest();
github traverson / traverson-hal / haltalk_test / haltalk.js View on Github external
after(function() {
    traverson.registerMediaType(JsonHalAdapter.mediaType, null);
  });
github traverson / traverson-hal / haltalk_test / haltalk.js View on Github external
before(function() {
    traverson.registerMediaType(JsonHalAdapter.mediaType, JsonHalAdapter);
  });
github traverson / traverson-hal / test / json_hal.js View on Github external
before(function() {
    traverson.registerMediaType(JsonHalAdapter.mediaType, JsonHalAdapter);
    api = traverson.from(rootUri).jsonHal();
  });
github traverson / traverson-hal / test / localhost.js View on Github external
before(function() {
    if (isNodeJs()) {
      testServer = require('traverson-test-server');
      testServer.start();
    }
    traverson.registerMediaType(JsonHalAdapter.mediaType, JsonHalAdapter);
 });
github traverson / traverson-hal / test / localhost.js View on Github external
beforeEach(function() {
    jsonHalApi = traverson
      .from(rootUri)
      .jsonHal()
      .newRequest()
      .withRequestOptions({
      headers: {
        'Accept': 'application/hal+json',
        'Content-Type': 'application/json'
      }
    });
    callback = sinon.spy();
  });
github traverson / traverson-hal / test / json_hal.js View on Github external
before(function() {
    traverson.registerMediaType(JsonHalAdapter.mediaType, JsonHalAdapter);
    api = traverson.from(rootUri).jsonHal();
  });

traverson

Hypermedia API/HATEOAS client for Node.js and the browser

MIT
Latest version published 2 years ago

Package Health Score

58 / 100
Full package analysis