test(packaging): added test for source map correctness

This commit is contained in:
Kara Erickson
2017-09-07 10:16:03 -07:00
committed by Matias Niemelä
parent 97cc6caa33
commit c8f742e288
10 changed files with 153 additions and 9 deletions

View File

@ -8,7 +8,6 @@
const STRIP_SRC_FILE_SUFFIXES = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/;
const GENERATED_FILE = /\.ngfactory\.|\.ngsummary\./;
const GENERATED_MODULE = /\.ngfactory$|\.ngsummary$/;
const JIT_SUMMARY_FILE = /\.ngsummary\./;
const JIT_SUMMARY_NAME = /NgSummary$/;

View File

@ -17,8 +17,8 @@ const _INDENT_WITH = ' ';
export const CATCH_ERROR_VAR = o.variable('error', null, null);
export const CATCH_STACK_VAR = o.variable('stack', null, null);
export abstract class OutputEmitter {
abstract emitStatements(
export interface OutputEmitter {
emitStatements(
srcFilePath: string, genFilePath: string, stmts: o.Statement[],
preamble?: string|null): string;
}

View File

@ -9,13 +9,8 @@
import * as o from './output/output_ast';
import {ParseError} from './parse_util';
const CAMEL_CASE_REGEXP = /([A-Z])/g;
const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
export function camelCaseToDashCase(input: string): string {
return input.replace(CAMEL_CASE_REGEXP, (...m: any[]) => '-' + m[1].toLowerCase());
}
export function dashCaseToCamelCase(input: string): string {
return input.replace(DASH_CASE_REGEXP, (...m: any[]) => m[1].toUpperCase());
}

View File

@ -27,7 +27,6 @@ import {componentFactoryResolverProviderDef, depDef, lifecycleHookToNodeFlag, pr
const CLASS_ATTR = 'class';
const STYLE_ATTR = 'style';
const IMPLICIT_TEMPLATE_VAR = '\$implicit';
const NG_CONTAINER_TAG = 'ng-container';
export class ViewCompileResult {
constructor(public viewClassVar: string, public rendererTypeVar: string) {}