/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/compiler-cli/src/ngtsc/indexer/test/context_spec.ts
47 строк
1 KB
Andrew Scott
refactor(compiler): Update indexer API to be generic
08 май 2026, 01:16
08 май 2026, 01:16
bc655d0
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC 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.dev/license */ import {ParseSourceFile} from '@angular/compiler'; import {runInEachFileSystem} from '../../file_system/testing'; import {IndexingContext} from '../src/context'; import * as util from './util'; import {AbstractBoundTemplate} from '../src/api'; import {DeclarationNode} from '../../reflection'; runInEachFileSystem(() => { describe('ComponentAnalysisContext', () => { it('should store and return information about components', () => { const context = new IndexingContext(); const declaration = util.getComponentDeclaration('class C {};', 'C'); const boundTemplate = util.getBoundTemplate('<div></div>'); context.addComponent({ declaration, selector: 'c-selector', boundTemplate, templateMeta: { isInline: false, file: new ParseSourceFile('<div></div>', declaration.getSourceFile().fileName), }, }); expect(context.components).toEqual( new Set([ { declaration, selector: 'c-selector', boundTemplate, templateMeta: { isInline: false, file: new ParseSourceFile('<div></div>', declaration.getSourceFile().fileName), }, }, ]), ); }); }); });