-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- 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
Showing
6 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
test/functional/fixtures/hammerhead/gh-3012/pages/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
14
test/functional/fixtures/hammerhead/gh-3012/pages/worker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); |
8 changes: 8 additions & 0 deletions
8
test/functional/fixtures/hammerhead/gh-3012/testcafe-fixtures/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:/); | ||
}); |