How to make funcunit close the new browser window after tests

789 Views Asked by At

I'm using funcunit for testing my JavascriptMVC application. It opens a new browser window where it runs my application. I wish it also closed the window after tests.

How to do that?

2

There are 2 best solutions below

2
On

Call:

FuncUnit._window.close();

It will close the opened window of the test.

module('General',{
    setup: function() {
        S.open('test.html');
    },
    teardown: function() {
        S._window.close();
    }
});

test('Test', function() {
    ok(true, 'I live again');
});
1
On

Call S.win.close() to close the window opened by funcunit . You can also access other stuff loaded in that like , accessing jQuery instance of that dom using S.win.$