-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
import/require xit, fixes #2972 #2997
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1464,6 +1464,7 @@ Mocha.prototype.ui = function (name) { | |
exports.before = context.before || context.suiteSetup; | ||
exports.describe = context.describe || context.suite; | ||
exports.it = context.it || context.test; | ||
exports.xit = context.xit || context.test; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small tip: you don't actually have to update the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ScottFreeCode Updated the PR with suggested changes. This time not updated mocha.js at root level. |
||
exports.setup = context.setup || context.beforeEach; | ||
exports.suiteSetup = context.suiteSetup || context.before; | ||
exports.suiteTeardown = context.suiteTeardown || context.after; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This is the only change that should be needed to merge this. Any others suggested are optional.)
So, the
context.test
on the right side of the||
isn't right, that's the same as for the non-skippedit
. (With that said, you can skip to the very bottom for recommended fix; the rest here is explanation.) I'm not 100% certain whether this involves the QUnit interface at all, but it seems these are basically enablingrequire
-based used of either the BDD or the TDD interface when either the BDD or TDD interface is used; so, the||
here would be to replicate the BDD interface in the event the TDD interface is chosen. So, I double-checked what the TDD interface does for skipping.In the BDD interface,
xit
,xspecify
andit.skip
are all set to a function that just callsit
while only using the title. In the TDD interface, there are nox
functions, andtest.skip
delegates to the "common interface"test.skip
, which in turn relies on the TDD interface'stest
function and -- like the BDD function -- just passes it only the title. (Weird coupling between the "common interface" and the TDD interface... but nothing worth worrying about here.)So it looks like it should be perfectly safe to change this to
|| context.test.skip
.