-
-
Notifications
You must be signed in to change notification settings - Fork 156
Implement RFC 232 (New QUnit Testing API) #208
Copy link
Copy link
Closed
Labels
Description
I 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
modulefromqunitandmoduleForfromember-qunit. I suppose I could exposemodulefromember-qunit, but this is something that we have avoided so far.... - I'd like to forbid nested
moduleForinvocations. If you are testing two different modules, IMHO, you should be using different test files. I am uncertain how you could stack twomoduleForcalls 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...
Reactions are currently unavailable