Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global object replaced on QUnit test #561

Open
Sheep-y opened this issue May 16, 2016 · 0 comments
Open

Global object replaced on QUnit test #561

Sheep-y opened this issue May 16, 2016 · 0 comments

Comments

@Sheep-y
Copy link

Sheep-y commented May 16, 2016

Blanket version: 1.2.1, used with QUnit 1.23.1.
Problem: Test ok with coverage off, fails with coverage on.
Cause: A global object is replaced before test is run.
Tested: Firefox 47, Chrome 51, IE 11

JS

var FooBar = {
   add: function ( foo ) {
      if ( FooBar !== foo ) throw 'Class mismatch';
   },
};

HTML

<!DOCTYPE html><meta charset='UTF-8' />

<link rel='stylesheet' href='qunit.css' />
<script src='qunit.js'></script>
<script src='blanket.js'></script>
<script src='test.js' data-cover></script>

<div id='qunit'></div>
<div id='qunit-fixture'></div>

<script>
const Foo = window.FooBar;

QUnit.test( 'Test', function ( assert ) {
   Foo.add( Foo ); // FooBar replaced by non-Foo, triggering throw
   assert.strictEqual( 1, 1, 'Ok' );
} );
</script>
@Sheep-y Sheep-y changed the title Global object replaced by clone Global object replaced on QUnit test May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant