Skip to content

Commit a6f85ca

Browse files
committed
Add unit tests
1 parent ce37d7e commit a6f85ca

File tree

5 files changed

+79
-166
lines changed

5 files changed

+79
-166
lines changed

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = function(config) {
1111

1212
// frameworks to use
1313
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
14-
frameworks: ['mocha', 'chai'],
14+
frameworks: ['jasmine'],
1515

1616

1717
// list of files / patterns to load in the browser

package-lock.json

Lines changed: 11 additions & 126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,17 @@
3434
"devDependencies": {
3535
"@babel/core": "^7.1.0",
3636
"@babel/preset-env": "^7.1.0",
37-
"chai": "^4.1.2",
3837
"eslint": "^5.16.0",
3938
"eslint-config-airbnb-base": "^13.1.0",
4039
"eslint-plugin-import": "^2.16.0",
4140
"karma": "^4.2.0",
4241
"karma-chai": "^0.1.0",
4342
"karma-chrome-launcher": "^2.2.0",
44-
"karma-mocha": "^1.3.0",
45-
"mocha": "^5.2.0",
43+
"karma-jasmine": "^4.0.1",
4644
"prettier": "^1.16.4",
4745
"puppeteer": "^1.18.1",
4846
"rollup": "^0.63.2",
4947
"rollup-plugin-babel": "^4.0.3"
50-
}
48+
},
49+
"dependencies": {}
5150
}

src/api.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ class DICOMwebClient {
187187
}
188188

189189
if (requestInterceptors) {
190+
console.debug('yes')
190191
const metadata = { method, url };
191192
const pipeRequestInterceptors = functions => (args) => functions.reduce((args, fn) => fn(args, metadata), args);
192193
const pipedRequest = pipeRequestInterceptors(requestInterceptors);
@@ -212,7 +213,10 @@ class DICOMwebClient {
212213
* @private
213214
*/
214215
_httpGet(url, headers, responseType, progressCallback) {
215-
return this._httpRequest(url, "get", headers, { responseType, progressCallback });
216+
return this._httpRequest(url, "get", headers, {
217+
responseType,
218+
progressCallback
219+
});
216220
}
217221

218222
/**
@@ -648,7 +652,10 @@ class DICOMwebClient {
648652
* @returns {Promise} Response
649653
*/
650654
_httpPost(url, headers, data, progressCallback) {
651-
return this._httpRequest(url, "post", headers, { data, progressCallback });
655+
return this._httpRequest(url, "post", headers, {
656+
data,
657+
progressCallback
658+
});
652659
}
653660

654661
/**

0 commit comments

Comments
 (0)