Skip to content

Instantly share code, notes, and snippets.

@teamdandelion
Created April 15, 2016 20:55
Show Gist options
  • Save teamdandelion/7761a63b662d044c36c2a5affdc69290 to your computer and use it in GitHub Desktop.
Save teamdandelion/7761a63b662d044c36c2a5affdc69290 to your computer and use it in GitHub Desktop.
Attempt to replace more than one element in wct
<!DOCTYPE html>
<html>
<head>
<link rel="import" href="../../polymer/polymer.html">
<script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../web-component-tester/browser.js"></script>
</head>
<body>
<script>
window.HTMLImports.whenReady(function() {
describe('a testing block', function() {
before(function() {
var toMock = ['foo-1', 'foo-2'];
toMock.forEach(function(x){
Polymer({
is: x,
amIMock: function() {
return false;
},
})
})
toMock.forEach(function(x) {
Polymer({
is: x + '-mock',
amIMock: function() {
return true;
}
})
replace(x).with(x+'-mock');
});
})
it('replacement occured', function() {
// pass
})
})
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment