Skip to content

Commit

Permalink
fix(api-angular): pass merge function to ms
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob McGuinness committed Apr 12, 2018
1 parent 1c4295e commit 6a3ea3c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/api-angular/src/ms.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function factory($http, $q, avApiOptions) {
super({
http: $http,
promise: $q,
merge: angular.merge,
config: options,
});
}
Expand Down
15 changes: 14 additions & 1 deletion packages/api-angular/src/tests/ms.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ describe('Api Definitions Angular', () => {
angular.mock.module(avModule);
});

describe('AvMicroservice', () => {
test('should initialize with constructor', () => {
angular.mock.inject(_AvMicroserviceApi_ => {
const AvMicroserviceApi = _AvMicroserviceApi_;
expect(AvMicroserviceApi).toBeDefined();
expect(() => {
// eslint-disable-next-line
new AvMicroserviceApi({ path: '/a/b', name: 'foo' });
}).not.toThrow();
});
});
});

test('avFilesApi should be defined', () => {
let avFilesApi;
angular.mock.inject(_avFilesApi_ => {
avFilesApi = _avFilesApi_;
expect(avFilesApi).toBeDefined();
});
expect(avFilesApi).toBeDefined();
});
});

0 comments on commit 6a3ea3c

Please sign in to comment.