integration-boot.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright 2020 Mozilla Foundation
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. "use strict";
  16. const Jasmine = require("jasmine");
  17. async function runTests(results) {
  18. const jasmine = new Jasmine();
  19. jasmine.exitOnCompletion = false;
  20. jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
  21. jasmine.loadConfig({
  22. random: false,
  23. spec_dir: "integration",
  24. spec_files: [
  25. "scripting_spec.js",
  26. "annotation_spec.js",
  27. "accessibility_spec.js",
  28. "find_spec.js",
  29. "freetext_editor_spec.js",
  30. "ink_editor_spec.js",
  31. "a11y_spec.js",
  32. ],
  33. });
  34. jasmine.addReporter({
  35. jasmineDone(suiteInfo) {},
  36. jasmineStarted(suiteInfo) {},
  37. specDone(result) {
  38. ++results.runs;
  39. if (result.failedExpectations.length > 0) {
  40. ++results.failures;
  41. console.log(`TEST-UNEXPECTED-FAIL | ${result.description}`);
  42. } else {
  43. console.log(`TEST-PASSED | ${result.description}`);
  44. }
  45. },
  46. specStarted(result) {},
  47. suiteDone(result) {},
  48. suiteStarted(result) {},
  49. });
  50. return jasmine.execute();
  51. }
  52. exports.runTests = runTests;