Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ember-qunit-nice-errors
Advanced tools
Because expected true, result false is not enough!
This addon aims to improve the testing experience by defining a nice message on those asserts that don't have one set by you.
As easy as ember install ember-qunit-nice-errors
When you have a test with a failing assertion and no custom message, the default error doesn't say much. As you can see by the following example test and the default ouput below:
import { module, test } from 'qunit';
module('Unit | ok test');
test('it works', function(assert) {
assert.ok(1===3);
});
But with ember-qunit-nice-errors the message is way nicer!
If you want your error messages to include the original test file, line and column where the failed assertion is, just add the following configuration on your config/environment.js
file:
ENV['ember-qunit-nice-errors'] = {
showFileInfo: true
};
assert.ok(false)
assert.ok(false) at my-app/tests/unit/ok-test.js:17:2
Also note you can enable this only for certain environments:
if (environment === 'development') {
ENV['ember-qunit-nice-errors'] = {
showFileInfo: true
};
}
If you fully trust us you can add this option to replace all assertions within your project tests, just add this to your configuration on your config/environment.js
file:
ENV['ember-qunit-nice-errors'] = {
completeExistingMessages: true
};
Don't worry, the override will still show your orginal messages, it is not a destructive operation!
The following example ilustrates what is the result of using the option completeExistingMessages
.
assert.ok(1 === 1, 'one should be one');
assert.ok(1 === 1, "assert.ok(1 === 1, 'one should be one')");
We are currently supporting all the assertions provided by QUnit, those are:
ok
notOk
equal
notEqual
deepEqual
notDeepEqual
propEqual
notPropEqual
strictEqual
notStrictEqual
We got inspiration from
ember-qunit-nice-errors is licensed under the MIT license.
See LICENSE for the full license text.
FAQs
Because expected true, result false is not enough!
The npm package ember-qunit-nice-errors receives a total of 3,719 weekly downloads. As such, ember-qunit-nice-errors popularity was classified as popular.
We found that ember-qunit-nice-errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.