Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Add test method to hooks object. #979

Closed

Conversation

jonnyreeves
Copy link

Provides an alias for QUnit.test to allow a more natural, nested nested api; this allows the author to write their tests as follows:

QUnit.module('action/example', t => {
    t.beforeEach(/* ... */);
    t.test('it should be awesome', assert => {
        assert.ok(true, 'rock and roll!');
    }
})

The downside I can see to this change is that it moves the existing convention away from the t / hooks argument being solely based around adding module hooks, however I feel there is a real benefit from not having to constantly write QUnit everywhere 😁

Thanks!

Provides an alias for `QUnit.test` to allow a more natural, nested nested api.
@jquerybot
Copy link

Thank you for your pull request. It looks like this may be your first contribution to a jQuery Foundation project, if so we need you to sign our Contributor License Agreement (CLA).

📝 Please visit http://contribute.jquery.org/CLA/ to sign.

After you signed, the PR is checked again automatically after a minute. If there's still an issue, please reply here to let us know.


If you've already signed our CLA, it's possible your git author information doesn't match your CLA signature (both your name and email have to match), for more information, check the status of your CLA check.

@jonnyreeves
Copy link
Author

Ah sorry, you are already discussing this feature in #978. Thanks again for your hard work on this awesome library.

@jonnyreeves jonnyreeves closed this Apr 3, 2016
@leobalter
Copy link
Member

thank you, @jonnyreeves!

Hooking the test on the callback arguments is the easiest part, the complexity comes registering the children tests as part of their parents. That's the biggest challenge at #978, I assume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants