angular/packages/bazel/test/ngc-wrapped/flat_module_test.ts
Andrew Kushnir b31973c176 test: remove Ivy/ViewEngine switch helpers and obsolete tests (#44120)
This commit removes special functions that were used to run tests in ViewEngine or Ivy only.
Since ViewEngine is deprecated and we no longer run ViewEngine tests on CI, we can cleanup
those special helpers and ViewEngine-only tests.

PR Close #44120
2021-11-24 19:42:39 +00:00

32 lines
958 B
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 {runfiles} from '@bazel/runfiles';
import {existsSync, readFileSync} from 'fs';
import {dirname, join} from 'path';
describe('flat_module ng_module', () => {
let packageOutput: string;
let flatModuleOutFile: string;
beforeAll(() => {
packageOutput =
dirname(runfiles.resolve('angular/packages/bazel/test/ngc-wrapped/flat_module/index.js'));
flatModuleOutFile = join(packageOutput, 'flat_module.js');
});
it('should have a flat module out file', () => {
expect(existsSync(flatModuleOutFile)).toBe(true);
});
describe('flat module out file', () => {
it('should have a proper AMD module name', () => {
expect(readFileSync(flatModuleOutFile, 'utf8')).toContain(`define("flat_module"`);
});
});
});