Comparing version 1.4.0 to 2.0.0
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://homer0.github.io/wootils/", | ||
"version": "1.4.0", | ||
"version": "2.0.0", | ||
"repository": "homer0/wootils", | ||
@@ -12,4 +12,4 @@ "author": "Leonardo Apiwan (@homer0) <me@homer0.com>", | ||
"jimple": "1.5.0", | ||
"fs-extra": "6.0.1", | ||
"colors": "1.3.0", | ||
"fs-extra": "7.0.1", | ||
"colors": "1.3.3", | ||
"urijs": "1.19.1", | ||
@@ -19,19 +19,20 @@ "statuses": "1.5.0" | ||
"devDependencies": { | ||
"eslint": "4.19.1", | ||
"eslint-config-airbnb-base": "13.0.0", | ||
"eslint-plugin-import": "2.12.0", | ||
"eslint-plugin-node": "6.0.1", | ||
"jest-ex": "5.0.0", | ||
"jest-cli": "23.1.0", | ||
"jasmine-expect": "3.8.3", | ||
"babel-preset-env": "1.7.0", | ||
"eslint": "5.13.0", | ||
"eslint-config-airbnb-base": "13.1.0", | ||
"eslint-plugin-import": "2.16.0", | ||
"eslint-plugin-node": "8.0.1", | ||
"jest-ex": "6.0.0", | ||
"jest-cli": "24.0.0", | ||
"jasmine-expect": "4.0.1", | ||
"@babel/preset-env": "7.0.0", | ||
"@babel/core": "7.2.2", | ||
"esdoc": "1.1.0", | ||
"esdoc-standard-plugin": "1.0.0", | ||
"esdoc-node": "1.0.3", | ||
"leasot": "6.3.0", | ||
"coveralls": "3.0.1" | ||
"esdoc-node": "1.0.4", | ||
"leasot": "7.2.0", | ||
"coveralls": "3.0.2" | ||
}, | ||
"engine-strict": true, | ||
"engines": { | ||
"node": ">=6.0.0", | ||
"node": ">=8.0.0", | ||
"npm": ">=3.0.0" | ||
@@ -38,0 +39,0 @@ }, |
@@ -131,2 +131,21 @@ jest.unmock('/shared/apiClient'); | ||
it('should be able to format an endpoint and add a parameter as query', () => { | ||
// Given | ||
const url = 'http://example.com'; | ||
const placeholder = 'param'; | ||
const placeholderValue = 'hello-world'; | ||
const endpointName = 'endpoint'; | ||
const endpointPath = 'some/path'; | ||
const endpoints = { | ||
[endpointName]: endpointPath, | ||
}; | ||
let sut = null; | ||
let result = null; | ||
// When | ||
sut = new APIClient(url, endpoints, () => {}); | ||
result = sut.endpoint(endpointName, { [placeholder]: placeholderValue }); | ||
// Then | ||
expect(result).toBe(`${url}/${endpointPath}?${placeholder}=${placeholderValue}`); | ||
}); | ||
it('should throw an error if a requested endpoint doesn\'t exist', () => { | ||
@@ -133,0 +152,0 @@ // Given |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
436741
4141
14
+ Addedcolors@1.3.3(transitive)
+ Addedfs-extra@7.0.1(transitive)
- Removedcolors@1.3.0(transitive)
- Removedfs-extra@6.0.1(transitive)
Updatedcolors@1.3.3
Updatedfs-extra@7.0.1