Add doc about Spec#after() method.
This commit is contained in:
parent
22e9434a50
commit
2ab6af1e48
|
@ -251,6 +251,19 @@ A runner can also have an afterEach declarations. Runner afterEach functions are
|
|||
};
|
||||
});
|
||||
|
||||
### Single-spec After functions
|
||||
|
||||
A spec may ask Jasmine to execute some code after the spec has finished running; the code will run whether the spec finishes successfully or not. Multiple after functions may be given.
|
||||
|
||||
describe('some suite', function () {
|
||||
it(function () {
|
||||
var originalTitle = window.title;
|
||||
this.after(function() { window.title = originalTitle; });
|
||||
MyWindow.setTitle("new value");
|
||||
expect(window.title).toEqual("new value");
|
||||
});
|
||||
|
||||
|
||||
### Nested Describes
|
||||
Jasmine supports nested describes. An example:
|
||||
|
||||
|
|
Loading…
Reference in New Issue