mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 01:54:04 +08:00
test: downgrade output of typescript to es2016 for istanbul
This commit is contained in:
parent
6bf80edf54
commit
8a796e7db5
12
lib/bootstrap-local.js
vendored
12
lib/bootstrap-local.js
vendored
@ -16,9 +16,16 @@ const ts = require('typescript');
|
||||
|
||||
const tmpRoot = temp.mkdirSync('angular-devkit-');
|
||||
|
||||
const compilerOptions = ts.readConfigFile(path.join(__dirname, '../tsconfig.json'), p => {
|
||||
return fs.readFileSync(p, 'utf-8');
|
||||
}).config;
|
||||
|
||||
let _istanbulRequireHook = null;
|
||||
if (process.env['CODE_COVERAGE'] || process.argv.indexOf('--code-coverage') !== -1) {
|
||||
_istanbulRequireHook = require('./istanbul-local').istanbulRequireHook;
|
||||
// async keyword isn't supported by the Esprima version used by Istanbul version used by us.
|
||||
// TODO: update istanbul to istanbul-lib-* (see http://istanbul.js.org/) and remove this hack.
|
||||
compilerOptions.compilerOptions.target = 'es2016';
|
||||
}
|
||||
|
||||
|
||||
@ -62,11 +69,6 @@ global._DevKitIsLocal = true;
|
||||
global._DevKitRoot = path.resolve(__dirname, '..');
|
||||
|
||||
|
||||
const compilerOptions = ts.readConfigFile(path.join(__dirname, '../tsconfig.json'), p => {
|
||||
return fs.readFileSync(p, 'utf-8');
|
||||
}).config;
|
||||
|
||||
|
||||
const oldRequireTs = require.extensions['.ts'];
|
||||
require.extensions['.ts'] = function (m, filename) {
|
||||
// If we're in node module, either call the old hook or simply compile the
|
||||
|
Loading…
x
Reference in New Issue
Block a user