Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 1.54 KB

no-test-module-for.md

File metadata and controls

70 lines (46 loc) · 1.54 KB

no-test-module-for

✅ The "extends": "plugin:ember/recommended" property in a configuration file enables this rule.

Use module instead of moduleFor.

moduleForComponent, moduleFor, moduleForAcceptance, etc have been deprecated and there are codemods to help migrate.

Examples

Examples of incorrect code for this rule:

import { moduleFor } from 'ember-qunit';

moduleFor('Test Name');

Examples of correct code for this rule:

import { module } from 'qunit';

module('Test Name', function (hooks) {
  // ...
});

Migration

A short guide for how each of the legacy APIs converts to the new APIs:

  • moduleFor, moduleForModel

    import { module, test } from 'qunit';
    import { setupTest } from 'ember-qunit';
    
    module('...', function (hooks) {
      setupTest(hooks);
    });
  • moduleForComponent

    import { module, test } from 'qunit';
    import { setupRenderingTest } from 'ember-qunit';
    
    module('...', function (hooks) {
      setupRenderingTest(hooks);
    });
  • moduleForAcceptance

    import { module, test } from 'qunit';
    import { setupApplicationTest } from 'ember-qunit';
    
    module('...', function (hooks) {
      setupApplicationTest(hooks);
    });

References