Skip to content

Commit

Permalink
Merge pull request #380 from Polymer/fixture-reversion
Browse files Browse the repository at this point in the history
reverted boolean blocking multiple calls to fixture teardown
  • Loading branch information
e111077 authored Sep 2, 2016
2 parents 50d177d + 680e5f0 commit 62201e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
15 changes: 5 additions & 10 deletions browser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion browser.js.map

Large diffs are not rendered by default.

15 changes: 5 additions & 10 deletions browser/mocha/fixture.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
import { extendInterfaces } from './extend';

var fixtureTeardownAttached = false;

extendInterfaces('fixture', function(context, teardown) {

// Return context.fixture if it is already a thing, for backwards
// compatibility with `test-fixture-mocha.js`:
return context.fixture || function fixture(fixtureId, model) {

if (!fixtureTeardownAttached) {
// Automatically register a teardown callback that will restore the
// test-fixture:
teardown(function() {
fixtureTeardownAttached = true;
document.getElementById(fixtureId).restore();
});
}
// Automatically register a teardown callback that will restore the
// test-fixture:
teardown(function() {
document.getElementById(fixtureId).restore();
});

// Find the test-fixture with the provided ID and create it, returning
// the results:
Expand Down

0 comments on commit 62201e0

Please sign in to comment.