Skip to content

Instantly share code, notes, and snippets.

View JoshuaVSherman's full-sized avatar
🏠
Working from home

Joshua V Sherman JoshuaVSherman

🏠
Working from home
View GitHub Profile
@JoshuaVSherman
JoshuaVSherman / gist:454704d7fc3fa2fa407263fd8c4aa1ee
Last active January 21, 2017 17:36
How to Unit Test a Function that Overwrites an Aurelia Component

To cover this particular function one needs to call app.configHttpClient() either directly, or by calling app.activate().

The httpClient is aurelia's fetch wrapper (docs: http://aurelia.io/hub.html#/doc/article/aurelia/fetch-client/latest/http-services/2) which is initialized in the App's constructor.

By default it's @injected by aurelia


import {inject} from 'aurelia-framework';
import {HttpClient} from 'aurelia-fetch-client';