question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement RFC 232 (New QUnit Testing API)

See original GitHub issue

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 module from qunit and moduleFor from ember-qunit. I suppose I could expose module from ember-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 two moduleFor 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:closed
  • Created 8 years ago
  • Reactions:10
  • Comments:25 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
rwjbluecommented, Oct 17, 2017
0reactions
rwjbluecommented, Oct 14, 2017

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found