jasmine-node
jasmine-node copied to clipboard
Possibility to label / tag tests
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.
+1 Cucumber has --tags for this: https://github.com/cucumber/cucumber/wiki/Tags
:+1:
+1
+1
+1
+1
+1
:+1:
This might do what you need : https://github.com/atom/jasmine-tagged
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']);
+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.
+1
👍
+1