eslint-plugin-ember icon indicating copy to clipboard operation
eslint-plugin-ember copied to clipboard

New rule: no-setupTest-from-ember-qunit

Open rwjblue opened this issue 2 years ago • 2 comments

As of [email protected] emberjs/rfcs#637 has been implemented in the new application blueprint.

Once an addon or application has migrated to using the new re-exports from tests/helpers/index.js they should no longer import them from the classic ember-qunit locations.

Rule details:

  • Prevent importing setupTest, setupApplicationTest, and setupRenderingTest from the ember-qunit module
  • Consider attempting to write a fixer that will add a new import from app-name/helpers instead.

Bad:

import { setupTest } from 'ember-qunit';
import { setupRenderingTest } from 'ember-qunit';
import { setupApplicationTest } from 'ember-qunit'

(all of these should be forbidden)

Good:

import { setupTest } from 'app-name/helpers';
import { setupRenderingTest } from 'app-name/helpers';
import { setupApplicationTest } from 'app-name/helpers';

rwjblue avatar Apr 24 '23 20:04 rwjblue

  • conditionally forbidden if there is a helpers file that contains those exports, ya?

NullVoxPopuli avatar Oct 09 '24 15:10 NullVoxPopuli

yes, exactly

rwjblue avatar Oct 09 '24 16:10 rwjblue