Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1642)

Unified Diff: test/test_support.ts

Issue 2416003003: Update package name, update and lock clang-format and tslint versions, and format all source files … (Closed)
Patch Set: Use ES6 Map and Set instead of Object literals to avoid ordering instability across different Node … Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/facade_converter_test.ts ('k') | tsconfig.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/test_support.ts
diff --git a/test/test_support.ts b/test/test_support.ts
index 912392d6558f5820e1c61aadc291f2a6995894b5..4035e4eb21b84a17193f910b9b4ab5d6ff2f2593 100644
--- a/test/test_support.ts
+++ b/test/test_support.ts
@@ -11,12 +11,14 @@ export type StringMap = {
};
export type Input = string | StringMap;
-export function expectTranslate(tsCode: Input, options: main.TranspilerOptions = {}) {
+export function expectTranslate(tsCode: Input, options?: main.TranspilerOptions) {
+ options = options || {};
let result = translateSource(tsCode, options);
return chai.expect(result);
}
-export function expectErroneousCode(tsCode: Input, options: main.TranspilerOptions = {}) {
+export function expectErroneousCode(tsCode: Input, options?: main.TranspilerOptions) {
+ options = options || {};
options.failFast = false; // Collect *all* errors.
return chai.expect(() => translateSource(tsCode, options));
}
@@ -72,7 +74,8 @@ export function parseFiles(nameToContent: StringMap): ts.Program {
export const FAKE_MAIN = 'demo/some/main.ts';
-export function translateSources(contents: Input, options: main.TranspilerOptions = {}): StringMap {
+export function translateSources(contents: Input, options?: main.TranspilerOptions): StringMap {
+ options = options || {};
// Default to quick stack traces.
if (!options.hasOwnProperty('failFast')) options.failFast = true;
let namesToContent: StringMap;
@@ -88,7 +91,8 @@ export function translateSources(contents: Input, options: main.TranspilerOption
return transpiler.translateProgram(program);
}
-export function translateSource(contents: Input, options: main.TranspilerOptions = {}): string {
+export function translateSource(contents: Input, options?: main.TranspilerOptions): string {
+ options = options || {};
let results = translateSources(contents, options);
// Return the main outcome, from 'main.ts'.
let result = results[FAKE_MAIN];
« no previous file with comments | « test/facade_converter_test.ts ('k') | tsconfig.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698