add docs, rename classes for clarity

This commit is contained in:
Art Lowel
2019-01-17 14:59:48 +01:00
parent e387f9446f
commit 586a4ac35b
23 changed files with 186 additions and 77 deletions

View File

@@ -31,6 +31,14 @@ export const createTestComponent = <T>(html: string, type: { new(...args: any[])
return fixture as ComponentFixture<T>;
};
/**
* Allows you to spy on a read only property
*
* @param obj
* The object to spy on
* @param prop
* The property to spy on
*/
export function spyOnOperator(obj: any, prop: string): any {
const oldProp = obj[prop];
Object.defineProperty(obj, prop, {