test: downgrade output of typescript to es2016 for istanbul

This commit is contained in:
Hans 2018-11-15 11:49:46 -08:00 committed by Minko Gechev
parent 6bf80edf54
commit 8a796e7db5

View File

@ -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