Skip to content
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

Lab.test.only and Lab.test.skip #110

Closed
jgallen23 opened this issue Jul 2, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@jgallen23
Copy link

@jgallen23 jgallen23 commented Jul 2, 2014

Mocha has a great feature that you can call test.only(function(done) { or test.skip(function(done) { and it will either only run that test or skip that test. Handy if you have a watcher and you just want to work on a single test without changing the cli args

hueniverse added a commit that referenced this issue Aug 3, 2014
@hueniverse hueniverse added the request label Aug 3, 2014
@hueniverse hueniverse added this to the 4.0.0 milestone Aug 3, 2014
@hueniverse hueniverse self-assigned this Aug 3, 2014
@hueniverse hueniverse closed this in 6803544 Aug 3, 2014
@Marsup

This comment has been minimized.

Copy link
Member

@Marsup Marsup commented Aug 12, 2014

@hueniverse doesn't work for me, shouldn't the following test pass ?

var Lab = require('lab');
var lab = exports.lab = Lab.script();

lab.describe('Level 1', function() {

  lab.it('should not run', function() {
    throw new Error();
  });

  lab.describe.only('Level 2', function() {
    lab.it('should run', function(done) {
      done();
    });
  });
});
@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Aug 12, 2014

@Marsup logged #154 and #155 to fix this

@Marsup

This comment has been minimized.

Copy link
Member

@Marsup Marsup commented Aug 12, 2014

Thanks @wpreul, wasn't sure whether I should open new one or reopen this.

@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Aug 12, 2014

@Marsup its more of a new bug, skip and only do work within the same script at the same level:

For example, this works correctly:

describe('Test CLI Not Only', function () {

    it('should not run', function (done) {

        throw new Error();
    });
});


describe.only('Test CLI Only', function () {

    it('should run', function (done) {

        done();
    });
});
@Marsup

This comment has been minimized.

Copy link
Member

@Marsup Marsup commented Aug 12, 2014

I was looking at the code and was wondering whether the "same script" behavior is desired or not. skip is pretty clear on its scope, only is debatable.

@Marsup Marsup added feature and removed request labels Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.