exception.js 1.1 KB

12345678910111213141516171819202122232425
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. if (this.WScript && this.WScript.LoadScriptFile) { // Check for running in ch
  6. this.WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
  7. }
  8. var tests = [
  9. {
  10. name: "With add, sub, mul",
  11. body: function () {
  12. assert.throws(() => {var x = 2n + 3;}, TypeError);
  13. assert.throws(() => {var x = 2 + 3n;}, TypeError);
  14. assert.throws(() => {var x = 2n - 3;}, TypeError);
  15. assert.throws(() => {var x = 2 - 3n;}, TypeError);
  16. assert.throws(() => {var x = 2n * 3;}, TypeError);
  17. assert.throws(() => {var x = 2 * 3n;}, TypeError);
  18. }
  19. },
  20. ];
  21. testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });