#28929: Incorrect example JS QUnit test
-----------------------------------------+------------------------
Reporter: Jan Fabry | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 2.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
[https://docs.djangoproject.com/en/dev/internals/contributing/writing-
code/javascript/#writing-tests The example QUnit test code] in the
"Contributing" part of the documentation uses the wrong kind of assertion.
Meta-meta I think, so not important, but it's still an error :-)
{{{
...
assert.equal($('.button').length === 1);
...
}}}
The `assert.equal` should either be `assert.ok`, or it should be
`assert.equal($('.button').length, 1)` (or `assert.strictEqual` if you
want the exact equivalent).
It's also in QUnit 1 format, while Django upgraded to QUnit 2 in
https://github.com/django/django/pull/7715, which has a different syntax.
--
Ticket URL: <https://code.djangoproject.com/ticket/28929>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.873db47750427cf6d89338211014e4d1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.