Skip to content

Instantly share code, notes, and snippets.

@luccastera
Created June 25, 2012 21:53
Show Gist options
  • Save luccastera/2991552 to your computer and use it in GitHub Desktop.
Save luccastera/2991552 to your computer and use it in GitHub Desktop.
jquery autosize global leak
<html>
<head>
<meta charset="utf-8">
<title>Global Leak - Mocha Test</title>
<link rel="stylesheet" href="https://raw.github.com/visionmedia/mocha/master/mocha.css" />
<script src="https://raw.github.com/visionmedia/mocha/master/mocha.js"></script>
<script>
mocha.setup({ui: 'bdd', globals: ['XMLHttpRequest']})
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://raw.github.com/jackmoore/autosize/master/jquery.autosize.js"></script>
<script>
$(function(){
describe('JQuery Autosize', function() {
it('has a global leak', function() {
$('input').autosize();
});
});
mocha.run()
})
</script>
</head>
<body>
<div id="mocha"></div>
<div style="display:none">
<input type="text" />
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment