New rule: `use-new-qunit-tests`
See original GitHub issueProposal
(The name could probably use some tweaking (man, naming is hard 😓 )
Goal of this rule is to enforce usage of the new-style qunit tests: http://rwjblue.com/2017/10/23/ember-qunit-simplication/
It should highlight places where we’re using old style qunit tests, using moduleForComponent
or moduleFor
. This could come especially handy when converting to new test syntax in bigger teams (where for some reason using codemod is out of the question) and also to enforce uniform usage (since the old style is still working).
Example (taken from RFC):
Component:
//=========
// bad
//=========
import { moduleForComponent, test } from 'ember-qunit';
//...
moduleForComponent('x-foo', {
integration: true
});
//...
//==========
// good
//==========
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
//...
module('x-foo', function(hooks) {
setupRenderingTest(hooks);
//..
});
Service/Controller/Route:
//==========
// bad
//==========
import { moduleFor, test } from 'ember-qunit';
moduleFor('service:flash', 'Unit | Service | Flash', {
unit: true
});
//...
//==========
// good
//==========
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Service | Flash', function(hooks) {
setupTest(hooks);
//...
});
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Proposed Rules - GovInfo
The revised. Common Rule includes provisions intended to strengthen the effectiveness of the human subject protection regulations, and FDA is ...
Read more >Recently Adopted Rules
Recently Adopted Rules. Adopted and rules are the final rules that must be followed by the regulated community after they take effect. Adopted...
Read more >Let the Population Collapse | Real Time with Bill Maher (HBO)
New Rule : Let the Population Collapse | Real Time with Bill Maher (HBO). 1.9M views 5 months ago. Real Time with Bill...
Read more >New Rules - Late in the Evening (Official Video) - YouTube
Listen to "Late in the Evening" everywhere now: http://newrules.lnk.to/liteFollow #NewRules:Instagram: ...
Read more >New Rule: Apply Precision to the Pandemic | Real Time (HBO)
Subscribe to the Real Time YouTube: http://itsh.bo/10r5A1BBill questions why the same people in medicine who, in private care, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Mifrill: We do have an existing rule no-test-module-for. I think that addresses most of what this issue was talking about?
Although it looks like there was a PR for a new rule
use-nested-qunit-syntax
(https://github.com/ember-cli/eslint-plugin-ember/pull/281 ) that got lost.This landed and is included in 5.3.0, will be in the recommended set with 6.0.0.