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

[BREAKING] commonConfig is no longer called #222

Open
sukima opened this issue Sep 11, 2019 · 1 comment
Open

[BREAKING] commonConfig is no longer called #222

sukima opened this issue Sep 11, 2019 · 1 comment

Comments

@sukima
Copy link

sukima commented Sep 11, 2019

In the past the use of the wrapped test/only would setup sinon to use QUnit's assertions for sinon's assertions. This was a big win as sinons assertion API is far superior, more readable, and offered better messaging then doing so manually via QUnit.assert.

However these helpers have been deprecated and the official documentation is to use the setupSinon which does not call commonConfig and therefor does not setup the assertion methods. This means that use of sinon's assertion API will not reflect in the QUnit reporting when they pass and will halt a test from continuing asserts because the default is to throw instead of fail like QUnit usually does.

Can setupSinon include this very minor but much wanted setup. It follows the same pattern as sinon's qunit integration guidelines.

Thank you.

sukima added a commit to sukima/ember-sinon-qunit that referenced this issue Sep 11, 2019
Fixes issue elwayman02#222 

This is a big win as sinon's assertion API is far superior, more readable, and offers better messaging then doing so manually.
sukima added a commit to sukima/ember-sinon-qunit that referenced this issue Sep 11, 2019
Fixes issue elwayman02#222

This is a big win as sinon's assertion API is far superior, more readable, and offers better messaging then doing so manually.
sukima added a commit to sukima/ember-sinon-qunit that referenced this issue Sep 11, 2019
Fixes issue elwayman02#222

This is a big win as sinon's assertion API is far superior, more readable, and offers better messaging then doing so manually.
@sukima
Copy link
Author

sukima commented Aug 17, 2021

For those curious you can manually enable sinon's assert API with the following lines:

import QUnit from 'qunit';
import sinon from 'sinon';

sinon.assert.pass = (assertion) => QUnit.assert.ok(true, assertion);
sinon.assert.fail = (assertion) => QUnit.assert.ok(false, assertion);

If the Authors are interested in including this into the current setupSinon I'll gladly make a PR for that.

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

No branches or pull requests

1 participant