Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

qUnit Teardown method

Is it possible to have teardown methods that run after every test in qUnit? If not, are there any plugins around that will do this?

like image 289
Charlie Avatar asked Jan 08 '10 14:01

Charlie


2 Answers

You can pass it in the module function like this:

module( "name", {teardown: function() {...}});
like image 179
Jacek Kołodziejczyk Avatar answered Oct 03 '22 18:10

Jacek Kołodziejczyk


You want to register a function with QUnit.testDone(func).
I have an example here:
How do I run a function before each test when using qUnit?

like image 44
Perry Tew Avatar answered Oct 03 '22 19:10

Perry Tew