From c986b4cc24aeea91bb2226a734a22362b8cc82f6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 5 Feb 2016 10:48:07 -0800 Subject: [PATCH] Add failing spec for custom error message --- spec/webview-spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/webview-spec.js b/spec/webview-spec.js index 904dfcab..faafec73 100644 --- a/spec/webview-spec.js +++ b/spec/webview-spec.js @@ -561,6 +561,17 @@ describe(' tag', function() { document.body.appendChild(webview); }); }); + + 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, 'stop can only be called after the dom-ready event is emitted'); + }); }); describe('executeJavaScript', function() { -- 2.43.0