jasmine-node icon indicating copy to clipboard operation
jasmine-node copied to clipboard

Possibility to label / tag tests

Open otomi opened this issue 11 years ago • 14 comments

is there anyway to add labels or tags to the tests and execute only the tests which match the tag? For example if I have multiple specs for different features and I would like to run only the tests which test Feature A, I could add to "It" clause or "describe" clause a tag @FeatureA or #FeatureA and execute jasmine-node with --tag featureA to execute only the specs / it's or describes matching that tag. Mocha has --grep for this kind of purpose.

otomi avatar Aug 11 '14 10:08 otomi

+1 Cucumber has --tags for this: https://github.com/cucumber/cucumber/wiki/Tags

elgalu avatar Jan 07 '15 15:01 elgalu

:+1:

mjgpy3 avatar Apr 29 '15 18:04 mjgpy3

+1

sapient-rwunsch avatar May 31 '15 20:05 sapient-rwunsch

+1

tophercf avatar Dec 01 '15 21:12 tophercf

+1

marilyn avatar Dec 23 '15 17:12 marilyn

+1

Alioshka avatar Feb 22 '16 07:02 Alioshka

+1

mika1111 avatar Feb 25 '16 11:02 mika1111

:+1:

tbys avatar Mar 03 '16 05:03 tbys

This might do what you need : https://github.com/atom/jasmine-tagged

a-c-m avatar Mar 04 '16 09:03 a-c-m

I have a couple of ideas on how to do this, let me know what you think. Option 1: single tag per it / describe describe.featureA('test for feature A'... it('inherits tag featureA from describe'...); it.featureB('overrides tag'...);

Option 2: multiple tags per it / describe describe('tests for features A and B'... it('inherits tags from describe'...); it('adds more tags', function..., ['anotherTag']); }, ['featureA', 'featureB']);

csymeonides avatar Apr 24 '16 17:04 csymeonides

+1 for the ability to tag individual describes / its in a spec!

Personally, I would prefer Option 2 of the ones suggested by csymeonides. It seems cleaner, and having the ability to add multiple tags in nested structures is definitely useful.

I've looked at jasmine-tagged, and I might end up using it "for now," but I'm not really fond of the idea of putting tags in the description string... it would seem to pollute the output.

Stephen-Williams avatar May 20 '16 16:05 Stephen-Williams

+1

juri33 avatar Feb 02 '17 13:02 juri33

👍

germandavid85 avatar Mar 02 '17 14:03 germandavid85

+1

jjm340 avatar Jul 20 '17 22:07 jjm340