mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
ec03e462f3
Migrate formatting to prettier for bazel, benchpress, elements and misc from clang-format PR Close #53995
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
/**
|
|
* @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.io/license
|
|
*/
|
|
|
|
import * as path from 'path';
|
|
|
|
import {setup} from './test_support';
|
|
|
|
describe('ngc_wrapped', () => {
|
|
it('should work', async () => {
|
|
const {read, write, runOneBuild, writeConfig, shouldExist, basePath, typesRoots} = setup();
|
|
|
|
write(
|
|
'some_project/index.ts',
|
|
`
|
|
import {Component} from '@angular/core';
|
|
import {a} from 'ambient_module';
|
|
console.log('works: ', Component);
|
|
`,
|
|
);
|
|
|
|
const typesFile = path.resolve(basePath, typesRoots, 'thing', 'index.d.ts');
|
|
|
|
write(
|
|
typesFile,
|
|
`
|
|
declare module "ambient_module" {
|
|
declare const a = 1;
|
|
}
|
|
`,
|
|
);
|
|
|
|
writeConfig({
|
|
srcTargetPath: 'some_project',
|
|
depPaths: [path.dirname(typesFile)],
|
|
});
|
|
|
|
// expect no error
|
|
expect(await runOneBuild()).toBe(true);
|
|
|
|
shouldExist('bazel-bin/some_project/index.js');
|
|
|
|
expect(read('bazel-bin/some_project/index.js')).toContain(
|
|
`console.log('works: ', core_1.Component);`,
|
|
);
|
|
});
|
|
});
|