-
Notifications
You must be signed in to change notification settings - Fork 27.4k
chore(ngMock): add they
helper for testing multiple specs
#10864
Conversation
This doesn't work yet with |
Nevermind. This stuff works great. Please merge. |
I believe that Jasmine sets |
break; | ||
default: | ||
method = it; | ||
} |
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.
How about replacing this switch
with something like:
var methods = {focus: iit, skip: xit, default: it};
var method = methods[specialState || 'default'];
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.
+1
I think this will make it harder to move to Jasmine 2.x, as in Jasmine 2.x, the function takes an optional |
we can handle the |
also note: commit message is wrong, this is not an ngMock change |
Angular/ngMock is also used by developers to test their modules, not only |
For Jasmine 2, the spec functions can take an optional If we were to migrate to supporing Jasmine 2 (which is not trivial for describe( ... ) {
it('should do something async', function(done) {
...
done();
};
var vals = [ ... ];
they('should do something async', function(vals, function(val, done) {
...
done();
}); Is there anything else we are missing here? If not then we should merge this once the other comments are addressed. |
@petebacondarwin yes, and ok |
There are now three new test helpers: `they`, `tthey` and `xthey`, which will create multiple `it`, `iit` and `xit` blocks, respectively, parameterized by each item in a collection that is passed. (with tests and ammendments by @petebacondarwin) Closes #10864
There are now three new test helpers: `they`, `tthey` and `xthey`, which will create multiple `it`, `iit` and `xit` blocks, respectively, parameterized by each item in a collection that is passed. (with tests and ammendments by @petebacondarwin) Closes angular#10864
There are now three new test helpers: `they`, `tthey` and `xthey`, which will create multiple `it`, `iit` and `xit` blocks, respectively, parameterized by each item in a collection that is passed. (with tests and ammendments by @petebacondarwin) Closes angular#10864
No description provided.