From 0aa2fe328f938e0f23dd45e3d596754de942cb92 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Thu, 9 Jun 2016 05:59:26 -0700 Subject: [PATCH] Add test for out-of-range error --- tests/cases/unittests/transpile.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/cases/unittests/transpile.ts b/tests/cases/unittests/transpile.ts index 8231f3c9745..a4b1416ed29 100644 --- a/tests/cases/unittests/transpile.ts +++ b/tests/cases/unittests/transpile.ts @@ -20,7 +20,7 @@ namespace ts { if (expectedDiagnosticTexts) { assert.equal(expectedDiagnosticTexts[i], diagnostics[i] && diagnostics[i].messageText); } - } + }; assert.equal(diagnostics.length, n, "Resuting diagnostics count does not match expected"); } @@ -319,11 +319,13 @@ var x = 0;`, }); it("Fails on bad value", () => { - test(``, { - options: { compilerOptions: { module: {} } }, - expectedDiagnosticCodes: [6046], - expectedDiagnosticTexts: ["Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015'"] - }); + for (const value in [123, {}, ""]) { + test(``, { + options: { compilerOptions: { module: value } }, + expectedDiagnosticCodes: [6046], + expectedDiagnosticTexts: ["Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015'"] + }); + } }); }); });