Skip to content

Instantly share code, notes, and snippets.

@aach
Created June 14, 2013 09:33
Show Gist options
  • Save aach/5780646 to your computer and use it in GitHub Desktop.
Save aach/5780646 to your computer and use it in GitHub Desktop.
Test how document body is cleaned/shared between tests and testcases
( function ( doc )
{
var BODY_ID = 'batman',
fpCommonSetUp = function ()
{
/*:DOC += <span class="batman"></span> */
};
TestCase( 'is body restored between tests?', {
setUp: function ()
{
fpCommonSetUp.call( this );
},
'test lazy': function ()
{
assertTrue( true );
},
'test that only the last one should survive': function ()
{
assertEquals( 1, doc.getElementsByClassName( 'batman' ).length );
},
'test that body id is shared between TestCases': function ()
{
doc.body.id = BODY_ID;
assertTrue( true );
}
} );
TestCase( 'the body id is shared between TestCases', {
'test that the body id is not empty': function ()
{
assertEquals( BODY_ID, doc.body.id );
}
} );
}( document ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment