Implement RFC 232 (New QUnit Testing API)
See original GitHub issueI would like to support nested modules, but I am unsure of the exact API.
Current front runner:
import { moduleFor, test } from 'ember-qunit';
import { module } from 'qunit';
moduleFor('foo:bar', function(hooks) {
hooks.beforeEach(function(assert) {
// any before each code needed
});
test('some non-nested test', function(assert) {
// stuff here
});
module('additional grouping', function(hooks) {
hooks.beforeEach(function(assert) {
// setup that is specific to `additional grouping` module
});
test('some test name here', function(assert) {
// stuff
});
});
});
Random thoughts:
- I’m not terribly happy with the above example having to import
module
fromqunit
andmoduleFor
fromember-qunit
. I suppose I could exposemodule
fromember-qunit
, but this is something that we have avoided so far… - I’d like to forbid nested
moduleFor
invocations. If you are testing two different modules, IMHO, you should be using different test files. I am uncertain how you could stack twomoduleFor
calls anyways (because both of their setups would try to “own” the test context and whatnot). Need to determine how to detect that we are being called in a nested context…
Issue Analytics
- State:
- Created 8 years ago
- Reactions:10
- Comments:25 (12 by maintainers)
Top Results From Across the Web
Top 5 qunit Code Examples
Learn more about how to use qunit, based on qunit code examples created from the most popular ways it is used in public...
Read more >Ember QUnit Simplification - Adventures in Open Source
A new API for unit and integration testing in Ember is ready for testing! Learn what the changes are, and how to use...
Read more >ember-qunit | Yarn - Package Manager
ember-qunit simplifies testing of Ember applications with QUnit by providing QUnit-specific wrappers around the helpers contained in ember-test-helpers.
Read more >Why Blueprints in Ember Are Cool and How They Save ...
blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__ ... For a recent app, which uses QUnit and the latest Ember QUnit API, ...
Read more >ember-qunit
Usage. The following section describes the use of ember-qunit with the latest modern Ember testing APIs, as laid out in the RFCs 232...
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
Closed by https://github.com/emberjs/ember-qunit/pull/286.
Yes, work is underway to implement emberjs/rfcs#232 which removes all of our custom wrapping around QUnit (and therefore allows us to fully embrace QUnit’s functionality here).