test(language-service): remove ng-if-cases.ts (#36470)

This commit removes ng-if-cases.ts and moves all test cases to inline
expressions in TEST_TEMPLATE.

PR Close #36470
This commit is contained in:
Keen Yee Liau 2020-04-06 19:47:29 -07:00 committed by Kara Erickson
parent e0415dbf16
commit 1dd0b6cc18
3 changed files with 2 additions and 23 deletions

View File

@ -11,7 +11,6 @@ import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {AppComponent} from './app.component';
import * as NgForCases from './ng-for-cases';
import * as NgIfCases from './ng-if-cases';
import * as ParsingCases from './parsing-cases';
@NgModule({
@ -21,7 +20,6 @@ import * as ParsingCases from './parsing-cases';
NgForCases.UnknownEven,
NgForCases.UnknownPeople,
NgForCases.UnknownTrackBy,
NgIfCases.ShowIf,
ParsingCases.AsyncForUsingComponent,
ParsingCases.CaseIncompleteOpen,
ParsingCases.CaseMissingClosing,

View File

@ -1,19 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Component} from '@angular/core';
@Component({
template: `
<div ~{start-implicit}*ngIf="show; let l=unknown"~{end-implicit}>
Showing now!
</div>`,
})
export class ShowIf {
show = false;
}

View File

@ -57,8 +57,8 @@ describe('plugin', () => {
const compilerDiags = tsLS.getCompilerOptionsDiagnostics();
expect(compilerDiags).toEqual([]);
const sourceFiles = program.getSourceFiles().filter(f => !f.fileName.endsWith('.d.ts'));
// there are five .ts files in the test project
expect(sourceFiles.length).toBe(5);
// there are three .ts files in the test project
expect(sourceFiles.length).toBe(3);
for (const {fileName} of sourceFiles) {
const syntacticDiags = tsLS.getSyntacticDiagnostics(fileName);
expect(syntacticDiags).toEqual([]);