Use assert.throws
This commit is contained in:
parent
bad4816976
commit
da6ebac742
1 changed files with 3 additions and 8 deletions
|
@ -563,14 +563,9 @@ describe('<webview> tag', function() {
|
|||
});
|
||||
|
||||
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.');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue