mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 07:34:08 +08:00
18 lines
366 B
JavaScript
18 lines
366 B
JavaScript
import initializer from 'wizard/initializers/load-helpers';
|
|
|
|
|
|
export function componentTest(name, opts) {
|
|
opts = opts || {};
|
|
|
|
test(name, function(assert) {
|
|
initializer.initialize(this.registry);
|
|
|
|
if (opts.setup) {
|
|
opts.setup.call(this);
|
|
}
|
|
|
|
andThen(() => this.render(opts.template));
|
|
andThen(() => opts.test.call(this, assert));
|
|
});
|
|
}
|