});
it('throws a custom error when an API method is called before the event is emitted', function() {
- var readyError = null;
- try {
- webview.stop();
- } catch (error) {
- readyError = error;
- }
-
- assert.equal(readyError.message, 'Cannot call stop because the webContents is unavailable. The WebView must be attached to the DOM and the dom-ready event emmitted before this method can be called.');
+ assert.throws(function () {
+ webview.stop()
+ }, 'Cannot call stop because the webContents is unavailable. The WebView must be attached to the DOM and the dom-ready event emmitted before this method can be called.');
});
});