From c719b252cb154e73673deed3f760883a9f60a7c7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 19 Jan 2016 10:57:18 -0800 Subject: [PATCH] Add failing spec --- spec/api-desktop-capturer-spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/api-desktop-capturer-spec.js b/spec/api-desktop-capturer-spec.js index 13c6f9e2e52a..85f3f194b751 100644 --- a/spec/api-desktop-capturer-spec.js +++ b/spec/api-desktop-capturer-spec.js @@ -11,4 +11,17 @@ describe('desktopCapturer', function() { done(); }); }); + + it('does not throw an error when called twice (regression)', function(done) { + var callCount = 0; + var callback = function(error, sources) { + callCount++; + assert.equal(error, null); + assert.notEqual(sources.length, 0); + if (callCount === 2) done(); + } + + desktopCapturer.getSources({types: ['window', 'screen']}, callback); + desktopCapturer.getSources({types: ['window', 'screen']}, callback); + }) });