Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
beef up currentScript test.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Jan 28, 2014
1 parent b99a12e commit 1cdcef2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/html/currentScript.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<script>
function test() {
chai.assert.equal(document._currentScript, document.currentScript, '_currentScript reflects currentScript');
chai.assert.isTrue(window.remoteCurrentScriptExecuted);
done();
}

Expand Down
2 changes: 2 additions & 0 deletions test/html/imports/current-script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
window.remoteCurrentScriptExecuted = true;
chai.assert.ok(document._currentScript);
4 changes: 3 additions & 1 deletion test/html/imports/script-1.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<div>me</div>
<script>
var d = document._currentScript.ownerDocument.querySelector('div');
chai.assert.ok(document._currentScript);
chai.assert.equal(d.innerHTML, 'me', '_currentScript can locate element in import')
</script>
</script>
<script src="current-script.js"></script>

0 comments on commit 1cdcef2

Please sign in to comment.