refactor(tsc-wrapped): move tsc-wrapped to the packages directory (#18160)
This commit is contained in:

committed by
Miško Hevery

parent
a6c635e69e
commit
619e625ee2
25
packages/tsc-wrapped/test/index_writer_spec.ts
Normal file
25
packages/tsc-wrapped/test/index_writer_spec.ts
Normal file
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @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 {MetadataBundler} from '../src/bundler';
|
||||
import {MetadataCollector} from '../src/collector';
|
||||
import {privateEntriesToIndex} from '../src/index_writer';
|
||||
|
||||
import {MockStringBundlerHost, SIMPLE_LIBRARY} from './bundler_spec';
|
||||
|
||||
describe('index_writer', () => {
|
||||
it('should be able to write the index of a simple library', () => {
|
||||
const host = new MockStringBundlerHost('/', SIMPLE_LIBRARY);
|
||||
const bundler = new MetadataBundler('/lib/index', undefined, host);
|
||||
const bundle = bundler.getMetadataBundle();
|
||||
const result = privateEntriesToIndex('./index', bundle.privates);
|
||||
expect(result).toContain(`export * from './index';`);
|
||||
expect(result).toContain(`export {PrivateOne as ɵa} from './src/one';`);
|
||||
expect(result).toContain(`export {PrivateTwo as ɵb} from './src/two/index';`);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user