parent
e1e44a910e
commit
f9426709ef
@ -63,7 +63,8 @@ export class DebugDomRenderer implements Renderer {
|
|||||||
projectNodes(parentElement: any, nodes: any[]) {
|
projectNodes(parentElement: any, nodes: any[]) {
|
||||||
var debugParent = getDebugNode(parentElement);
|
var debugParent = getDebugNode(parentElement);
|
||||||
if (isPresent(debugParent) && debugParent instanceof DebugElement) {
|
if (isPresent(debugParent) && debugParent instanceof DebugElement) {
|
||||||
nodes.forEach((node) => { debugParent.addChild(getDebugNode(node)); });
|
let debugElement = debugParent;
|
||||||
|
nodes.forEach((node) => { debugElement.addChild(getDebugNode(node)); });
|
||||||
}
|
}
|
||||||
this._delegate.projectNodes(parentElement, nodes);
|
this._delegate.projectNodes(parentElement, nodes);
|
||||||
}
|
}
|
||||||
|
@ -131,16 +131,17 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An
|
|||||||
var timeOut = testTimeOut;
|
var timeOut = testTimeOut;
|
||||||
|
|
||||||
if (testFn instanceof FunctionWithParamTokens) {
|
if (testFn instanceof FunctionWithParamTokens) {
|
||||||
|
let testFnT = testFn;
|
||||||
jsmFn(name, (done) => {
|
jsmFn(name, (done) => {
|
||||||
var returnedTestValue;
|
var returnedTestValue;
|
||||||
try {
|
try {
|
||||||
returnedTestValue = testInjector.execute(testFn);
|
returnedTestValue = testInjector.execute(testFnT);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
done.fail(err);
|
done.fail(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testFn.isAsync) {
|
if (testFnT.isAsync) {
|
||||||
if (_isPromiseLike(returnedTestValue)) {
|
if (_isPromiseLike(returnedTestValue)) {
|
||||||
(<Promise<any>>returnedTestValue).then(() => { done(); }, (err) => { done.fail(err); });
|
(<Promise<any>>returnedTestValue).then(() => { done(); }, (err) => { done.fail(err); });
|
||||||
} else {
|
} else {
|
||||||
@ -178,16 +179,17 @@ export function beforeEach(fn: FunctionWithParamTokens | AnyTestFn): void {
|
|||||||
if (fn instanceof FunctionWithParamTokens) {
|
if (fn instanceof FunctionWithParamTokens) {
|
||||||
// The test case uses inject(). ie `beforeEach(inject([ClassA], (a) => { ...
|
// The test case uses inject(). ie `beforeEach(inject([ClassA], (a) => { ...
|
||||||
// }));`
|
// }));`
|
||||||
|
let fnT = fn;
|
||||||
jsmBeforeEach((done) => {
|
jsmBeforeEach((done) => {
|
||||||
|
|
||||||
var returnedTestValue;
|
var returnedTestValue;
|
||||||
try {
|
try {
|
||||||
returnedTestValue = testInjector.execute(fn);
|
returnedTestValue = testInjector.execute(fnT);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
done.fail(err);
|
done.fail(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fn.isAsync) {
|
if (fnT.isAsync) {
|
||||||
if (_isPromiseLike(returnedTestValue)) {
|
if (_isPromiseLike(returnedTestValue)) {
|
||||||
(<Promise<any>>returnedTestValue).then(() => { done(); }, (err) => { done.fail(err); });
|
(<Promise<any>>returnedTestValue).then(() => { done(); }, (err) => { done.fail(err); });
|
||||||
} else {
|
} else {
|
||||||
|
@ -135,6 +135,7 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An
|
|||||||
if (testFn instanceof FunctionWithParamTokens) {
|
if (testFn instanceof FunctionWithParamTokens) {
|
||||||
// The test case uses inject(). ie `it('test', inject([AsyncTestCompleter], (async) => { ...
|
// The test case uses inject(). ie `it('test', inject([AsyncTestCompleter], (async) => { ...
|
||||||
// }));`
|
// }));`
|
||||||
|
let testFnT = testFn;
|
||||||
|
|
||||||
if (testFn.hasToken(AsyncTestCompleter)) {
|
if (testFn.hasToken(AsyncTestCompleter)) {
|
||||||
jsmFn(name, (done) => {
|
jsmFn(name, (done) => {
|
||||||
@ -150,13 +151,13 @@ function _it(jsmFn: Function, name: string, testFn: FunctionWithParamTokens | An
|
|||||||
runner.run();
|
runner.run();
|
||||||
|
|
||||||
inIt = true;
|
inIt = true;
|
||||||
testInjector.execute(testFn);
|
testInjector.execute(testFnT);
|
||||||
inIt = false;
|
inIt = false;
|
||||||
}, timeOut);
|
}, timeOut);
|
||||||
} else {
|
} else {
|
||||||
jsmFn(name, () => {
|
jsmFn(name, () => {
|
||||||
runner.run();
|
runner.run();
|
||||||
testInjector.execute(testFn);
|
testInjector.execute(testFnT);
|
||||||
}, timeOut);
|
}, timeOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user