mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 21:03:52 +08:00
71d37953d5
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.
18 lines
406 B
JavaScript
18 lines
406 B
JavaScript
import initializer from "wizard/initializers/load-helpers";
|
|
import { test } from "qunit";
|
|
|
|
export function componentTest(name, opts) {
|
|
opts = opts || {};
|
|
|
|
test(name, function (assert) {
|
|
initializer.initialize(this.registry);
|
|
|
|
if (opts.beforeEach) {
|
|
opts.beforeEach.call(this);
|
|
}
|
|
|
|
andThen(() => this.render(opts.template));
|
|
andThen(() => opts.test.call(this, assert));
|
|
});
|
|
}
|