Skip to content

Commit 0aa2fe3

Browse files
author
Andy Hanson
committed
Add test for out-of-range error
1 parent d8667ae commit 0aa2fe3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/cases/unittests/transpile.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace ts {
2020
if (expectedDiagnosticTexts) {
2121
assert.equal(expectedDiagnosticTexts[i], diagnostics[i] && diagnostics[i].messageText);
2222
}
23-
}
23+
};
2424
assert.equal(diagnostics.length, n, "Resuting diagnostics count does not match expected");
2525
}
2626

@@ -319,11 +319,13 @@ var x = 0;`,
319319
});
320320

321321
it("Fails on bad value", () => {
322-
test(``, {
323-
options: { compilerOptions: { module: <ModuleKind><any>{} } },
324-
expectedDiagnosticCodes: [6046],
325-
expectedDiagnosticTexts: ["Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015'"]
326-
});
322+
for (const value in [123, {}, ""]) {
323+
test(``, {
324+
options: { compilerOptions: { module: <ModuleKind><any>value } },
325+
expectedDiagnosticCodes: [6046],
326+
expectedDiagnosticTexts: ["Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015'"]
327+
});
328+
}
327329
});
328330
});
329331
});

0 commit comments

Comments
 (0)