JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://sinonjs.org/releases/sinon-1.7.3.js"></script>
JavaScript
var $window = $(window);
sinon.stub($window, 'width').returns(900);
// "900"
$('body').append('<div>Stubbed window width: ' + $window.width() + '</div>');
// real window width
$('body').append('<div>Window width read from fresh jQuery object (not affected by the stub): ' + $(window).width() + '</div>');