-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from THEOplayer/maintenance/e2e_await_player
Fix waiting for player to be ready
- Loading branch information
Showing
5 changed files
with
91 additions
and
14 deletions.
There are no files selected for viewing
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
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,55 @@ | ||
diff --git a/node_modules/cavy/src/Reporter.js b/node_modules/cavy/src/Reporter.js | ||
index 1cdeb38..f7e9e35 100644 | ||
--- a/node_modules/cavy/src/Reporter.js | ||
+++ b/node_modules/cavy/src/Reporter.js | ||
@@ -9,7 +9,15 @@ export default class Reporter { | ||
// Internal: Creates a websocket connection to the cavy-cli server. | ||
onStart() { | ||
const url = 'ws://127.0.0.1:8082/'; | ||
+ console.debug('Creating websocket'); | ||
this.ws = new WebSocket(url); | ||
+ this.ws.onerror = console.error | ||
+ this.ws.onopen = () => { | ||
+ console.debug('Successfully opened websocket'); | ||
+ } | ||
+ this.ws.onclose = () => { | ||
+ console.debug('Closing websocket'); | ||
+ } | ||
} | ||
|
||
// Internal: Send a single test result to cavy-cli over the websocket connection. | ||
@@ -34,7 +42,6 @@ export default class Reporter { | ||
console.log(message); | ||
} | ||
} | ||
- | ||
// Private: Determines whether data can be sent over the websocket. | ||
websocketReady() { | ||
// WebSocket.readyState 1 means the web socket connection is OPEN. | ||
diff --git a/node_modules/cavy/src/Tester.js b/node_modules/cavy/src/Tester.js | ||
index c61e31a..8d222ae 100644 | ||
--- a/node_modules/cavy/src/Tester.js | ||
+++ b/node_modules/cavy/src/Tester.js | ||
@@ -57,20 +57,8 @@ export default class Tester extends Component { | ||
key: Math.random() | ||
}; | ||
this.testHookStore = props.store; | ||
- // Default to sending a test report to cavy-cli if no custom reporter is | ||
- // supplied. | ||
- if (props.reporter instanceof Function) { | ||
- const message = 'Deprecation warning: support for custom function' + | ||
- 'reporters will soon be deprecated. Cavy supports custom ' + | ||
- 'class based reporters. For more info, see the ' + | ||
- 'documentation here: ' + | ||
- 'https://cavy.app/docs/guides/writing-custom-reporters'; | ||
- console.warn(message); | ||
- this.reporter = props.reporter; | ||
- } else { | ||
- reporterClass = props.reporter || Reporter; | ||
- this.reporter = new reporterClass; | ||
- } | ||
+ reporterClass = props.reporter || Reporter; | ||
+ this.reporter = new reporterClass; | ||
} | ||
|
||
componentDidMount() { |
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
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
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