mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add previous tests
This commit is contained in:
@@ -79,6 +79,34 @@ function test_basic() {
|
||||
}
|
||||
|
||||
function test_config() {
|
||||
RestangularProvider.setBaseUrl('/api/v1');
|
||||
RestangularProvider.setExtraFields(['name']);
|
||||
RestangularProvider.setResponseExtractor(function (response, operation) {
|
||||
return response.data;
|
||||
});
|
||||
|
||||
RestangularProvider.setDefaultHttpFields({ cache: true });
|
||||
RestangularProvider.setMethodOverriders(["put", "patch"]);
|
||||
|
||||
RestangularProvider.setErrorInterceptor(function (response) {
|
||||
console.error('' + response.status + ' ' + response.data);
|
||||
});
|
||||
|
||||
RestangularProvider.setRestangularFields({
|
||||
id: "_id",
|
||||
route: "restangularRoute"
|
||||
});
|
||||
|
||||
RestangularProvider.setRequestSuffix('.json');
|
||||
|
||||
RestangularProvider.setRequestInterceptor(function (element, operation, route, url) {
|
||||
});
|
||||
|
||||
RestangularProvider.addElementTransformer('accounts', false, function (elem) {
|
||||
elem.accountName = 'Changed';
|
||||
return elem;
|
||||
});
|
||||
|
||||
var myRestangular = Restangular.withConfig((configurer: RestangularProvider) => {
|
||||
configurer.setBaseUrl('/api/v1');
|
||||
configurer.setExtraFields(['name']);
|
||||
|
||||
Reference in New Issue
Block a user