browser_gcli_fail.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright 2012, Mozilla Foundation and contributors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. "use strict";
  17. // THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT
  18. // PLEASE TALK TO SOMEONE IN DEVELOPER TOOLS BEFORE EDITING IT
  19. const exports = {};
  20. function test() {
  21. helpers.runTestModule(exports, "browser_gcli_fail.js");
  22. }
  23. // var helpers = require('./helpers');
  24. exports.testBasic = function (options) {
  25. return helpers.audit(options, [
  26. {
  27. setup: "tsfail reject",
  28. exec: {
  29. output: "rejected promise",
  30. type: "error",
  31. error: true
  32. }
  33. },
  34. {
  35. setup: "tsfail rejecttyped",
  36. exec: {
  37. output: "54",
  38. type: "number",
  39. error: true
  40. }
  41. },
  42. {
  43. setup: "tsfail throwerror",
  44. exec: {
  45. output: /thrown error$/,
  46. type: "error",
  47. error: true
  48. }
  49. },
  50. {
  51. setup: "tsfail throwstring",
  52. exec: {
  53. output: "thrown string",
  54. type: "error",
  55. error: true
  56. }
  57. },
  58. {
  59. setup: "tsfail noerror",
  60. exec: {
  61. output: "no error",
  62. type: "string",
  63. error: false
  64. }
  65. }
  66. ]);
  67. };