Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.12 KB

no-test-this-render.md

File metadata and controls

47 lines (32 loc) · 1.12 KB

no-test-this-render

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

Ember's this.render/this.clearRender method and @ember/test-helpers's render/clearRender method are equivalent, but using @ember/test-helpers' render/clearRender method is the recommended approach.

Rule Details

The rule invites users to call @ember/test-helpers' render/clearRender method instead of this.render/this.clearRender in tests.

Examples

Examples of incorrect code for this rule:

test('baz', function (assert) {
  this.render();
});
test('baz', function (assert) {
  this.clearRender();
});

Examples of correct code for this rule:

import { render } from '@ember/test-helpers';

test('baz', function (assert) {
  render();
});
import { clearRender } from '@ember/test-helpers';

test('baz', function (assert) {
  clearRender();
});

References