Conversation
src/core.js
Outdated
| asyncTest: asyncTest, | ||
| asyncTest: function() { | ||
| throw new Error( | ||
| "asyntTest is now removed from QUnit 2.0, check out our upgrade guide at " + |
There was a problem hiding this comment.
s/asyntTest/asyncTest/. And as an aside, I notice that only some of the removals come with throws... when will we fully complete the process and drop even these?
There was a problem hiding this comment.
I've set throws only for removed methods as asyncTest, init, stop, and the previously exposed globals.
I skipped throwing for features as setup/teardown, test signature, etc.
There was a problem hiding this comment.
This should mention QUnit.test() with assert.async() as replacement:
"asyncTest is removed in QUnit 2.0, use QUnit.test() with assert.async() instead. Details in our upgrade guide at " +
There was a problem hiding this comment.
Then apply that to any other replacements as well.
f660082 to
74102e4
Compare
|
@gibson042 is there anything I should change? @jzaefferer would you take a look on this one? |
src/export.js
Outdated
| } | ||
| ( function() { | ||
| var i; | ||
| var assertions = Assert.prototype; |
There was a problem hiding this comment.
TL;DR: yes.
that's a mess I'm making after changes that happened on our style guide. It was a suggesting a single var and then it suggested 1 var per line, stacking non initialized variables on the same line. Now there's nothing and I'm confused.
At least on of the examples the style guide is using a single var, so I'll apply the change you suggested.
There was a problem hiding this comment.
Okay. I personally prefer 1 var per line, but everywhere else in QUnit we use a single var.
There was a problem hiding this comment.
done! I fixed this on a rebased commit, my bad I amended to a fixup commit.
|
Overall 👍. Still need to get that typo mentioned here. |
- globals - assertions on QUnit namespace - QUnit.stop - QUnit.init - setup/teardown - asyncTest - test with expected and async parameters - old style for logging callbacks - duration property on testDone details
|
I'll wait for @jzaefferer to take a look on this, as he mentioned he will do it tomorrow, or today on his timezone. :) After it's merged I'll proceed merging the other done PRs with breaking changes. I'll probably try a pre-release so we can all test it on different suites. |
| // DEPRECATED: handles setup/teardown functions, | ||
| // beforeEach and afterEach should be used instead | ||
| if ( testEnvironment && testEnvironment.setup ) { | ||
| testEnvironment.beforeEach = testEnvironment.setup; |
There was a problem hiding this comment.
This should throw an error as well, otherwise the setup and teardown properties are simply ignored, breaking tests in unexpected ways.
There was a problem hiding this comment.
We can't throw, otherwise removing it on 2.1 would be a breaking change.
We may log a warning, console.warn is available on the set of supported browsers for 2.0
src/export.js
Outdated
| function applyDeprecated( name ) { | ||
| return function() { | ||
| throw new Error( | ||
| "`" + name + "` is removed in QUnit 2.0, you should now use the " + |
There was a problem hiding this comment.
Let's drop the backticks; this isn't a great error message:
The global okis removed…
There was a problem hiding this comment.
ef9c175 what do you think? Also the global message is "The global ok is removed..."
|
@jquery/qunit I believe I addressed all the reviews so far, how is it now? |
src/test.js
Outdated
| config.current.semaphore -= 1; | ||
|
|
||
| // If semaphore is non-numeric, throw error | ||
| if ( isNaN( config.current.semaphore ) ) { |
There was a problem hiding this comment.
This is probably unnecessary now that the function is internal.
There was a problem hiding this comment.
semaphore is still exposed. Can we remove it securely? I'll check this.
There was a problem hiding this comment.
If so, I can do this (es5 + ie9+ support ftw):
Object.defineProperty(config.current, "semaphore", { set: function() { throw ... } ));There was a problem hiding this comment.
semaphore is not documented, so anyone using it directly is already coloring outside the lines.
There was a problem hiding this comment.
21c254a I tried this refactoring, it's working and it avoids using the config.current using test directly whenever is possible. I'll do a inline comment to show the point I'm not satisfied
There was a problem hiding this comment.
I cannot do any inline comments because it's not close from a change I did:
You can see here I have this resumeProcessing() that can't be called with the current test where done was set in. Doing it breaks the current suite.
We can investigate this in another issue, but for me it looks we are leaking the async functionality somehow and our current tests are returning false positives.
|
There seems to be a little cruft from arguments handling, but I'm satisfied overall. LGTM. |
Use test.semaphore directly whenever is possible instead of config.current.semaphore
This is the first batch. It can be improved and QUnit.reset is not addressed here yet.