mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REFACTOR: Import QUnit and related helpers rather than globals
We used many global functions to handle tests when they should be imported like other libraries in our application. This also gets us closer to the way Ember CLI prefers our tests to be laid out.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { test, module } from "qunit";
|
||||
import { run } from "@ember/runloop";
|
||||
import startApp from "wizard/test/helpers/start-app";
|
||||
|
||||
var wizard;
|
||||
QUnit.module("Acceptance: wizard", {
|
||||
module("Acceptance: wizard", {
|
||||
beforeEach() {
|
||||
wizard = startApp();
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { moduleForComponent } from "ember-qunit";
|
||||
import { componentTest } from "wizard/test/helpers/component-test";
|
||||
moduleForComponent("invite-list", { integration: true });
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import initializer from "wizard/initializers/load-helpers";
|
||||
import { test } from "qunit";
|
||||
|
||||
export function componentTest(name, opts) {
|
||||
opts = opts || {};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { moduleFor } from "ember-qunit";
|
||||
import { test } from "qunit";
|
||||
import WizardField from "wizard/models/wizard-field";
|
||||
|
||||
moduleFor("model:wizard-field");
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
//= require route-recognizer/dist/route-recognizer
|
||||
//= require fake_xml_http_request
|
||||
//= require pretender/pretender
|
||||
//= require qunit/qunit/qunit
|
||||
//= require ember-qunit
|
||||
//= require discourse-loader
|
||||
//= require jquery.debug
|
||||
//= require handlebars
|
||||
//= require ember-template-compiler
|
||||
//= require qunit/qunit/qunit
|
||||
//= require ember-qunit
|
||||
//= require wizard-application
|
||||
//= require wizard-vendor
|
||||
//= require helpers/assertions
|
||||
|
||||
Reference in New Issue
Block a user