1

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?

Community
  • 1
  • 1
raimohanska
  • 3,265
  • 17
  • 28

2 Answers2

1

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.$

deven98602
  • 1,090
  • 9
  • 19
0

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');
});
koalix
  • 133
  • 2
  • 7