Skip to content

Commit

Permalink
Testing HH build (#8369)
Browse files Browse the repository at this point in the history
<!--
Thank you for your contribution.

Before making a PR, please read our contributing guidelines at

https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md#code-contribution

We recommend creating a *draft* PR, so that you can mark it as 'ready
for review' when you are done.
-->

## Purpose
closes DevExpress/testcafe-hammerhead#3035
closes #8368

## Approach
_Describe how your changes address the issue or implement the desired
functionality in as much detail as possible._

## References
_Provide a link to the existing issue(s), if any._

## Pre-Merge TODO
- [ ] Write tests for your proposed changes
- [ ] Make sure that existing tests do not fail

---------

Co-authored-by: Bayheck <[email protected]>
  • Loading branch information
Bayheck and Bayheck authored Feb 13, 2025
1 parent 0bf5f51 commit bf84955
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 24 deletions.
49 changes: 26 additions & 23 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"source-map-support": "^0.5.16",
"strip-bom": "^2.0.0",
"testcafe-browser-tools": "2.0.26",
"testcafe-hammerhead": "31.7.4",
"testcafe-hammerhead": "31.7.5",
"testcafe-legacy-api": "5.1.8",
"testcafe-reporter-json": "^2.1.0",
"testcafe-reporter-list": "^2.2.0",
Expand Down
15 changes: 15 additions & 0 deletions test/functional/fixtures/hammerhead/gh-3012/pages/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Worker</title>
</head>
<body>
<script>
const worker = new Worker("worker.js");
worker.onmessage = (e) => {
console.log(e.data);
};
</script>
</body>
</html>
14 changes: 14 additions & 0 deletions test/functional/fixtures/hammerhead/gh-3012/pages/worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const asyncThunkSymbol = 'asyncThunkSymbol';

function buildCreateSlice ({ creators } = {}) {
return creators?.asyncThunk?.[asyncThunkSymbol];
}

try {
const shouldBeUndefined = buildCreateSlice();

postMessage(`OK: ${shouldBeUndefined}`);
}
catch (error) {
postMessage(error);
}
5 changes: 5 additions & 0 deletions test/functional/fixtures/hammerhead/gh-3012/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Worker header', function () {
it('Should not break due to undefined optional chaining', function () {
return runTests('testcafe-fixtures/index.js', null);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fixture `Worker`
.page `http://localhost:3000/fixtures/hammerhead/gh-3012/pages/index.html`;

test('Should not break due to undefined optional chaining', async t => {
const { log } = await t.getBrowserConsoleMessages();

await t.expect(log[0]).match(/^OK:/);
});

0 comments on commit bf84955

Please sign in to comment.