Skip to content

Commit b28d77f

Browse files
author
Bayheck
committed
testing: testcafe-hammerhead build testing
1 parent b56702e commit b28d77f

File tree

6 files changed

+45
-7
lines changed

6 files changed

+45
-7
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"source-map-support": "^0.5.16",
145145
"strip-bom": "^2.0.0",
146146
"testcafe-browser-tools": "2.0.26",
147-
"testcafe-hammerhead": "31.7.5",
147+
"testcafe-hammerhead": "https://github.com/Bayheck/Builds/raw/main/testcafe-hammerhead-31.7.5.tgz",
148148
"testcafe-legacy-api": "5.1.8",
149149
"testcafe-reporter-json": "^2.1.0",
150150
"testcafe-reporter-list": "^2.2.0",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Worker</title>
6+
</head>
7+
<body>
8+
<h1>Worker With Modules</h1>
9+
<button id="btn">get the answer!</button>
10+
<output id="out"></output>
11+
</body>
12+
<script>
13+
const btn = document.getElementById("btn");
14+
const out = document.getElementById("out");
15+
16+
const worker = new Worker("./worker.js", { type: "module" });
17+
btn.onclick = () => worker.postMessage("");
18+
worker.onmessage = (ev) => (out.textContent = ev.data);
19+
</script>
20+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
onmessage = () => postMessage(100);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('Worker module type', function () {
2+
it('Should not break due to importScripts with module workers', function () {
3+
return runTests('testcafe-fixtures/index.js', null);
4+
});
5+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Selector } from 'testcafe';
2+
3+
fixture `Worker`
4+
.page `http://localhost:3000/fixtures/hammerhead/gh-3046/pages/index.html`;
5+
6+
test('Should not break due to importScripts with module workers', async t => {
7+
await t.expect(Selector('#out').textContent).eql('');
8+
await t.debug();
9+
await t.click(Selector('#btn'));
10+
await t.debug();
11+
await t.expect(Selector('#out').textContent).eql('100');
12+
});

0 commit comments

Comments
 (0)