#25781 closed enhancement (fixed)
QUnit should be testable on both compiled and minimized JS
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.8 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Build/Test Tools | Keywords: | has-patch |
Focuses: | Cc: |
Description
Discussed in IRC https://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2013-10-30&sort=asc#m717593 , we want to make our testing more verbose.
Attachments (6)
Change History (23)
#3
@
12 years ago
The new patch uses copy and processContent instead of adding another dependency as suggested by Nacin.
#5
@
12 years ago
Thanks ocean90, at least I spelled everything correctly (I think).
25781.3.diff should fix that
@
12 years ago
Cleaned up spacing in 25781.3.diff, removed spaces-to-tabs conversion within a comment
#6
@
12 years ago
I edited 25781.3.diff to unify the whitespace style, and remove an edit to an unrelated comment that got caught in the spaces-to-tabs find/replace.
#8
@
12 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In 26063:
#10
@
12 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
We should ignore the created compiled.html file so that after running the tests it doesn't show up in an svn status.
#11
@
12 years ago
qunit:compiled runs clean:qunit when done, removing compiled.html. Of course, it is still possible for it to end up left behind.
#12
@
12 years ago
Hmm, mine was left before but reran it and this time it wasn't.
Overall, this seems like a bad idea as it makes it harder to test in browsers. Right now to test in browsers other than phantomjs, we can't run qunit:compiled, we need to run each command individually. If we have clean:qunit run before copy:qunit-compiled instead of after qunit, we gain this ability.
#14
@
11 years ago
Now I remember why I did it the other way. The problem is if you run grunt qunit
later, the compiled QUnit will be run, but it will be out of date.
Two options. One is grunt qunit:index
and grunt qunit:compiled
. Ideally, though, grunt qunit
can be used just for qunit:index
. This is not possible without a big hack and/or this enhancement upstream, as found by jorbin.
The second one is a bit of a hack, as attached as 25781.5.diff. Ideally, qunit:compiled runs it on the uncompiled as well, but I couldn't get it to execute qunit
then set the config then re-execute qunit
. It's a queueing system and things work async and such.
#15
@
11 years ago
A second hacky option as attached as 25781.6.diff is to use filter to filter out everything but index.html when we are running just qunit. Both my approach and Nacin's are far from perfect but I think keeping the hack in the config makes it a bit more readable. Either way, inline docs as to why we are doing it this way (or a link to the ticket) would be helpful.
To run, I've added the new task
grunt test:compiled