mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 04:56:19 +08:00
19 lines
436 B
JavaScript
19 lines
436 B
JavaScript
/* eslint-disable no-undef */
|
|
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));
|
|
});
|
|
}
|