2017-03-12 09:27:47 -04:00
|
|
|
const testPackage = require('../../helpers/test-package');
|
|
|
|
const processorFactory = require('./markBarredODocsAsPrivate');
|
|
|
|
const Dgeni = require('dgeni');
|
|
|
|
|
2017-06-29 08:49:54 -04:00
|
|
|
describe('markBarredODocsAsPrivate processor', () => {
|
2017-03-12 09:27:47 -04:00
|
|
|
|
|
|
|
it('should be available on the injector', () => {
|
2017-04-21 08:10:52 -04:00
|
|
|
const dgeni = new Dgeni([testPackage('angular-api-package')]);
|
2017-03-12 09:27:47 -04:00
|
|
|
const injector = dgeni.configureInjector();
|
|
|
|
const processor = injector.get('markBarredODocsAsPrivate');
|
|
|
|
expect(processor.$process).toBeDefined();
|
|
|
|
expect(processor.$runAfter).toContain('readTypeScriptModules');
|
|
|
|
expect(processor.$runBefore).toContain('adding-extra-docs');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should mark docs starting with barred-o ɵ as private', () => {
|
|
|
|
const processor = processorFactory();
|
|
|
|
const docs = [
|
|
|
|
{ name: 'ɵPrivate' },
|
|
|
|
{ name: 'public' }
|
2017-04-01 14:34:10 -04:00
|
|
|
];
|
2017-03-12 09:27:47 -04:00
|
|
|
processor.$process(docs);
|
|
|
|
|
|
|
|
expect(docs[0].privateExport).toBeTruthy();
|
|
|
|
expect(docs[1].privateExport).toBeFalsy();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|