Ember/5/Convert Module For To Setup Test

1.0.2Last update Jan 10, 2025
by@Codemod
Ember
migration

This codemod transforms from the older moduleFor* syntax of ember-qunit@2 to the newer setup*Test syntax.

Before

import { moduleFor, test } from "ember-qunit";
moduleFor("service:flash", "Unit | Service | Flash", {
unit: true,
});
test("should allow messages to be queued", function (assert) {
let subject = this.subject();
});

After

import { setupTest } from "ember-qunit";
import { module, test } from "qunit";
module("Unit | Service | Flash", function (hooks) {
setupTest(hooks);
test("should allow messages to be queued", function (assert) {
let subject = this.owner.lookup("service:flash");
});
});

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now