-
-
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
dynamic skip -- works in some places... #1625
Comments
Thanks for mentioning it! We've been discussing this bug in #1618 (comment) as well. |
@danielstjules should this be closed? |
@boneskull no, sorry for the confusion - that's my bad. It's a separate issue from #1604 The PR I brought up gives us the ability to use For another example, see #1618 (comment) The result of that test suite should probably be 2 pending specs. |
pace #1618 -- my tests look sync, but they are using promises, so actually async. in "before" I do some db setup, which I need to have done before I can decide on skip(), so wrapping for delayed definition becomes cumbersome. I could put the whole module inside |
Ah I see - using |
+1 for async skip! |
…a lacking support for async skip (mochajs/mocha#1625)
Reviewing this issue since some of the other async skip issues have since been fixed; I expanded the test cases to cover all combinations like so:
describe "beforeEach", ->
describe "outer", ->
beforeEach ->
@skip()
it "should be skipped", ->
describe "outer", ->
beforeEach ->
@skip()
describe "inner", ->
it "should be skipped", ->
describe "outer", ->
beforeEach ->
@skip()
it "should be skipped", ->
describe "inner", ->
it "should be skipped", ->
describe "before", ->
describe "outer", ->
before ->
@skip()
it "should be skipped", ->
describe "outer", ->
before ->
@skip()
describe "inner", ->
it "should be skipped", ->
describe "outer", ->
before ->
@skip()
it "should be skipped", ->
describe "inner", ->
it "should be skipped", -> (And, just to be on the safe side:)
describe("beforeEach", function() {
describe("outer", function() {
beforeEach(function() {
this.skip()
})
it("should be skipped", function() {})
})
describe("outer", function() {
beforeEach(function() {
this.skip()
})
describe("inner", function() {
it("should be skipped", function() {})
})
})
describe("outer", function() {
beforeEach(function() {
this.skip()
})
it("should be skipped", function() {})
describe("inner", function() {
it("should be skipped", function() {})
})
})
})
describe("before", function() {
describe("outer", function() {
before(function() {
this.skip()
})
it("should be skipped", function() {})
})
describe("outer", function() {
before(function() {
this.skip()
})
describe("inner", function() {
it("should be skipped", function() {})
})
})
describe("outer", function() {
before(function() {
this.skip()
})
it("should be skipped", function() {})
describe("inner", function() {
it("should be skipped", function() {})
})
})
}) Both output:
@mochajs/core Is it expected that |
I am a bot that watches issues for inactivity. |
let's try to consolidate the open issues around the skip behavior. |
With current master |
Thanks very much for dynamic skip!
It works well for me like this:
However, it doesn't work if the "beforeEach is in a wrapping suite:
Also doesn't seem to work in "before".
The text was updated successfully, but these errors were encountered: