test(ivy): fix strict null checks failures in ngcc tests (#30967)
9d9c9e43e5
has been created a few days ago
and wasn't rebased on top of recent changes that introduces a commonjs host.
This means that tests for the commonjs host haven't been updated to work with
the changes from from #30492 and now fail in `master`.
PR Close #30967
This commit is contained in:
parent
2b4d5c7548
commit
230e9766f6
|
@ -1273,7 +1273,7 @@ describe('CommonJsReflectionHost', () => {
|
|||
|
||||
const fooNode =
|
||||
getDeclaration(program, FUNCTION_BODY_FILE.name, 'foo', isNamedFunctionDeclaration) !;
|
||||
const fooDef = host.getDefinitionOfFunction(fooNode);
|
||||
const fooDef = host.getDefinitionOfFunction(fooNode) !;
|
||||
expect(fooDef.node).toBe(fooNode);
|
||||
expect(fooDef.body !.length).toEqual(1);
|
||||
expect(fooDef.body ![0].getText()).toEqual(`return x;`);
|
||||
|
@ -1283,7 +1283,7 @@ describe('CommonJsReflectionHost', () => {
|
|||
|
||||
const barNode =
|
||||
getDeclaration(program, FUNCTION_BODY_FILE.name, 'bar', isNamedFunctionDeclaration) !;
|
||||
const barDef = host.getDefinitionOfFunction(barNode);
|
||||
const barDef = host.getDefinitionOfFunction(barNode) !;
|
||||
expect(barDef.node).toBe(barNode);
|
||||
expect(barDef.body !.length).toEqual(1);
|
||||
expect(ts.isReturnStatement(barDef.body ![0])).toBeTruthy();
|
||||
|
@ -1296,7 +1296,7 @@ describe('CommonJsReflectionHost', () => {
|
|||
|
||||
const bazNode =
|
||||
getDeclaration(program, FUNCTION_BODY_FILE.name, 'baz', isNamedFunctionDeclaration) !;
|
||||
const bazDef = host.getDefinitionOfFunction(bazNode);
|
||||
const bazDef = host.getDefinitionOfFunction(bazNode) !;
|
||||
expect(bazDef.node).toBe(bazNode);
|
||||
expect(bazDef.body !.length).toEqual(3);
|
||||
expect(bazDef.parameters.length).toEqual(1);
|
||||
|
@ -1305,7 +1305,7 @@ describe('CommonJsReflectionHost', () => {
|
|||
|
||||
const quxNode =
|
||||
getDeclaration(program, FUNCTION_BODY_FILE.name, 'qux', isNamedFunctionDeclaration) !;
|
||||
const quxDef = host.getDefinitionOfFunction(quxNode);
|
||||
const quxDef = host.getDefinitionOfFunction(quxNode) !;
|
||||
expect(quxDef.node).toBe(quxNode);
|
||||
expect(quxDef.body !.length).toEqual(2);
|
||||
expect(quxDef.parameters.length).toEqual(1);
|
||||
|
|
Loading…
Reference in New Issue