DefinitelyTyped/types/traverson/traverson-tests.ts
Vladimir Jelovac 789017a31e
@types/traverson - updating type definitions to match new version of the JS library (#45256)
* @types/traverson - adding missing method to the builder interface

* @types/traverson - adding missing methods to the builder interface

* @types/traverson - Updating the project url and adding myself to the definition author

* @types/traverson - run prettier on traverson-tests

* @types/traverson - bugfix added missing walk() arguments

* @types/traverson - apparenlty prettier adds a space before the opening brace when used with the function keyword, this seems to break the test.

* @types/traverson - added misssing methods.
2020-06-24 02:11:07 -04:00

21 lines
561 B
TypeScript

import traverson = require('traverson');
function testTraverson() {
var mediaTypeHandler: any = {};
traverson.registerMediaType('application/some-fancy+json', mediaTypeHandler);
traverson
.from('http://example.api.com/')
.follow('link_to')
.withTemplateParameters({ id: 1 })
.get((error, document, traversal) => {
traversal
.continue()
.follow('link_back')
.get((error, document, traversal) => {
///
});
});
}