This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/test_helper.js
Robin Ward ef7d99b0a8 REFACTOR: Move test setup to a module
This is long overdue. We had a lot of (not linted) code to initialize
our test suite as part of the Ruby `test_helper.js` bundle.

This refactor moves that out to a `setup-tests` module, which imports
all the modules properly, rather than using `require`.

It also removes the global `server` variable which some tests were using
for pretender. Those tests are fixed, and in the case of widget tests,
support for a `pretend()` was added, which mimics our acceptance tests.

One problematic test was removed, which overwrites `/posts` - this could
break tons of other tests depending on order.
2020-10-08 15:11:51 -04:00

50 lines
1.2 KiB
JavaScript

// discourse-skip-module
/*global document, sinon, QUnit, Logster */
//= require env
//= require jquery.debug
//= require jquery.ui.widget
//= require ember.debug
//= require message-bus
//= require qunit/qunit/qunit
//= require ember-qunit
//= require fake_xml_http_request
//= require route-recognizer
//= require pretender/pretender
//= require locales/i18n
//= require locales/en_US
//= require discourse-loader
// Our base application
//= require vendor
//= require discourse-shims
//= require pretty-text-bundle
//= require markdown-it-bundle
//= require application
//= require admin
// These are not loaded in prod or development
// But we need them for testing handlebars templates in qunit
//= require handlebars
//= require ember-template-compiler
// Test helpers
//= require sinon/pkg/sinon
//= require_tree ./helpers
//= require break_string
// Finally, the tests themselves
//= require_tree ./fixtures
//= require_tree ./acceptance
//= require_tree ./integration
//= require_tree ./unit
//= require_tree ../../admin/tests/admin
//= require plugin_tests
//= require setup-tests
//= require_self
//
//= require jquery.magnific-popup.min.js
let setupTests = require("discourse/tests/setup-tests").default;
setupTests(window.Discourse);