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

Error thrown when test titles are non-strings #136

Closed
phillipskevin opened this issue May 12, 2017 · 1 comment
Closed

Error thrown when test titles are non-strings #136

phillipskevin opened this issue May 12, 2017 · 1 comment
Assignees
Labels

Comments

@phillipskevin
Copy link
Contributor

An error is thrown when data.title is a non-string here: new mocha.Test(data.title, true).

(node:26651) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Test `title` should be a "string" but "number" was given instead.
(node:26651) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: No test information found for {"file":"http://localhost:3996/test/index.html","id":"3579e9fb15341a2bdf24b2bd7ee32d3b","title":5,"parent":"64b475e08b3b8c40f6040445dadc1695","status":"passed","state":"passed"}

This happens in situations like this:

QUnit.ok(m.l[0].id, 5, "correct props");

We should coerce these titles to strings.

@andrejewski
Copy link
Contributor

We've discussed and this is not an issue with Testee itself, if we look at the erroneous line:

QUnit.ok(m.l[0].id, 5, "correct props");

We can see that this assertion is incorrect, it should be an .equal(). That is a QUnit error. The best thing we can do here in Testee is add a troubleshooting section for "UnhandledPromiseRejectionWarning" letting people know it is most likely because they are asserting incorrectly.

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

No branches or pull requests

2 participants