Skip to content

Commit

Permalink
update script tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Sep 17, 2021
1 parent 730b56e commit 84a7fc3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
16 changes: 8 additions & 8 deletions tests/script/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ <h1 class="title">Script</h1>
<script type="text/partytown">
(function () {
const script = document.createElement('script');
jsonp = function (data) {
jsonpA = function (data) {
const elm = document.getElementById('testJSONP');
elm.textContent = data.mph;
script.remove();
elm.className = 'testJSONP';
};
script.dataset.testjsonp = true;
script.src = './jsonp.js';
script.src = './jsonp-a.js';
document.head.appendChild(script);
})();
</script>
Expand All @@ -82,11 +82,11 @@ <h1 class="title">Script</h1>
script.parentElement.removeChild(script);
elm.className = 'testOnLoad';
};
jsonp = function (data) {
elm.textContent = data.mph + 11;
jsonpB = function (data) {
elm.textContent = data.mph;
};
script.dataset.testonload = true;
script.src = './jsonp.js';
script.src = './jsonp-b.js';
document.head.appendChild(script);
})();
</script>
Expand All @@ -103,10 +103,10 @@ <h1 class="title">Script</h1>
script.parentElement.removeChild(script);
elm.className = 'testAddEventListenerLoad';
});
jsonp = function (data) {
elm.textContent = data.mph - 11;
jsonpC = function (data) {
elm.textContent = data.mph;
};
script.src = './jsonp.js';
script.src = './jsonp-c.js';
document.head.appendChild(script);
})();
</script>
Expand Down
1 change: 1 addition & 0 deletions tests/script/jsonp-a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jsonpA({ mph: 88 });
1 change: 1 addition & 0 deletions tests/script/jsonp-b.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jsonpB({ mph: 99 });
1 change: 1 addition & 0 deletions tests/script/jsonp-c.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jsonpC({ mph: 77 });
1 change: 0 additions & 1 deletion tests/script/jsonp.js

This file was deleted.

1 comment on commit 84a7fc3

@vercel
Copy link

@vercel vercel bot commented on 84a7fc3 Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.