Skip to content

Instantly share code, notes, and snippets.

@bsatrom
Created March 25, 2011 18:09
Show Gist options
  • Save bsatrom/887293 to your computer and use it in GitHub Desktop.
Save bsatrom/887293 to your computer and use it in GitHub Desktop.
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