test(upgrade): add diagnosis to failing ivy tests (#27542)

PR Close #27542
This commit is contained in:
Pete Bacon Darwin 2018-12-07 10:49:39 +00:00 committed by Alex Rickabaugh
parent 055dc2d9a2
commit 2a35471abe

View File

@ -1641,9 +1641,10 @@ withEachNg1Version(() => {
});
}));
describe('with lifecycle hooks', () => {
fixmeIvy('unknown').it(
'should call `$onInit()` on controller', async(() => {
describe('with life-cycle hooks', () => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should call `$onInit()` on controller', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const $onInitSpyA = jasmine.createSpy('$onInitA');
const $onInitSpyB = jasmine.createSpy('$onInitB');
@ -1734,8 +1735,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should call `$doCheck()` on controller', async(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should call `$doCheck()` on controller', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const $doCheckSpyA = jasmine.createSpy('$doCheckA');
const $doCheckSpyB = jasmine.createSpy('$doCheckB');
@ -1844,8 +1846,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should call `$postLink()` on controller', async(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should call `$postLink()` on controller', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const $postLinkSpyA = jasmine.createSpy('$postLinkA');
const $postLinkSpyB = jasmine.createSpy('$postLinkB');
@ -1862,7 +1865,8 @@ withEachNg1Version(() => {
controllerAs: '$ctrl',
controller: class {$postLink() { $postLinkSpyA(); }}
}))
.directive('ng1B', () => ({
.directive(
'ng1B', () => ({
template: '',
scope: {},
bindToController: false,
@ -1936,8 +1940,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should call `$onChanges()` on binding destination', fakeAsync(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should call `$onChanges()` on binding destination', fakeAsync(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const $onChangesControllerSpyA = jasmine.createSpy('$onChangesControllerA');
const $onChangesControllerSpyB = jasmine.createSpy('$onChangesControllerB');
@ -1962,15 +1967,15 @@ withEachNg1Version(() => {
this.$onChanges = $onChangesControllerSpyA;
}
}))
.directive(
'ng1B',
() => ({
.directive('ng1B', () => ({
template: '',
scope: {valB: '<'},
bindToController: false,
controllerAs: '$ctrl',
controller: class {
$onChanges(changes: SimpleChanges) { $onChangesControllerSpyB(changes); }
$onChanges(changes: SimpleChanges) {
$onChangesControllerSpyB(changes);
}
}
}))
.directive('ng2', adapter.downgradeNg2Component(Ng2Component))
@ -2031,8 +2036,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should call `$onDestroy()` on controller', fakeAsync(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should call `$onDestroy()` on controller', fakeAsync(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const $onDestroySpyA = jasmine.createSpy('$onDestroyA');
const $onDestroySpyB = jasmine.createSpy('$onDestroyB');
@ -2064,7 +2070,8 @@ withEachNg1Version(() => {
controllerAs: '$ctrl',
controller: class {$onDestroy() { $onDestroySpyA(); }}
}))
.directive('ng1B', () => ({
.directive(
'ng1B', () => ({
template: '',
scope: {},
bindToController: false,
@ -2122,8 +2129,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should not call `$onDestroy()` on scope', fakeAsync(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should not call `$onDestroy()` on scope', fakeAsync(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const $onDestroySpy = jasmine.createSpy('$onDestroy');
let ng2ComponentInstance: Ng2Component;
@ -2153,7 +2161,8 @@ withEachNg1Version(() => {
bindToController: true,
controllerAs: '$ctrl',
controller: function($scope: angular.IScope) {
Object.getPrototypeOf($scope).$onDestroy = $onDestroySpy;
Object.getPrototypeOf($scope).$onDestroy =
$onDestroySpy;
}
}))
.directive('ng1B', () => ({
@ -2446,8 +2455,9 @@ withEachNg1Version(() => {
});
describe('linking', () => {
fixmeIvy('unknown').it(
'should run the pre-linking after instantiating the controller', async(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should run the pre-linking after instantiating the controller', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const log: string[] = [];
@ -2464,7 +2474,8 @@ withEachNg1Version(() => {
}
// Define `ng1Module`
const ng1Module = angular.module('ng1', [])
const ng1Module =
angular.module('ng1', [])
.directive('ng1', () => ng1Directive)
.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
@ -2484,8 +2495,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should run the pre-linking function before linking', async(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should run the pre-linking function before linking', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const log: string[] = [];
@ -2503,7 +2515,8 @@ withEachNg1Version(() => {
}
// Define `ng1Module`
const ng1Module = angular.module('ng1', [])
const ng1Module =
angular.module('ng1', [])
.directive('ng1A', () => ng1DirectiveA)
.directive('ng1B', () => ng1DirectiveB)
.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
@ -2525,8 +2538,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should run the post-linking function after linking (link: object)', async(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should run the post-linking function after linking (link: object)', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const log: string[] = [];
@ -2544,7 +2558,8 @@ withEachNg1Version(() => {
}
// Define `ng1Module`
const ng1Module = angular.module('ng1', [])
const ng1Module =
angular.module('ng1', [])
.directive('ng1A', () => ng1DirectiveA)
.directive('ng1B', () => ng1DirectiveB)
.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
@ -2566,8 +2581,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should run the post-linking function after linking (link: function)', async(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should run the post-linking function after linking (link: function)', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const log: string[] = [];
@ -2585,7 +2601,8 @@ withEachNg1Version(() => {
}
// Define `ng1Module`
const ng1Module = angular.module('ng1', [])
const ng1Module =
angular.module('ng1', [])
.directive('ng1A', () => ng1DirectiveA)
.directive('ng1B', () => ng1DirectiveB)
.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
@ -2607,8 +2624,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should run the post-linking function before `$postLink`', async(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should run the post-linking function before `$postLink`', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const log: string[] = [];
@ -2625,7 +2643,8 @@ withEachNg1Version(() => {
}
// Define `ng1Module`
const ng1Module = angular.module('ng1', [])
const ng1Module =
angular.module('ng1', [])
.directive('ng1', () => ng1Directive)
.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
@ -3096,14 +3115,16 @@ withEachNg1Version(() => {
}));
});
fixmeIvy('unknown').it(
'should bind input properties (<) of components', async(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should bind input properties (<) of components', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const ng1Module = angular.module('ng1', []);
const ng1 = {
bindings: {personProfile: '<'},
template: 'Hello {{$ctrl.personProfile.firstName}} {{$ctrl.personProfile.lastName}}',
template:
'Hello {{$ctrl.personProfile.firstName}} {{$ctrl.personProfile.lastName}}',
controller: class {}
};
ng1Module.component('ng1', ng1);
@ -3129,8 +3150,9 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('unknown').it(
'should support ng2 > ng1 > ng2', async(() => {
fixmeIvy(
'FW-812: Life-cycle hooks not correctly wired up for components that return a different instance from their constructor')
.it('should support ng2 > ng1 > ng2', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
const ng1Module = angular.module('ng1', []);