Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using qunit and jsmock to test the ie9ify plugin. Sadly, it doesn't look like I can mock any of the new site mode functions
// Getting closer...
var ctrl = new MockControl();
var windowMock = ctrl.createMock(window.external);
//normally, you wouldn't need this next line, but it seems to be required in this case because window.external is a black box
windowMock.addMockMethod('msIsSiteMode');
windowMock.expects().msIsSiteMode().andReturn(true);
//But this is still false...
equals($.ie9ify.isPinned(), true, 'isPinned should be true');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment