From 1f61e16eb57e4d5fb4fd06011feb490ca1d3d35f Mon Sep 17 00:00:00 2001 From: Zeno Rocha Date: Mon, 28 Sep 2015 21:59:18 -0700 Subject: [PATCH] Fails silently in favor of speed --- src/clipboard.js | 4 ---- test/clipboard.js | 22 ---------------------- 2 files changed, 26 deletions(-) diff --git a/src/clipboard.js b/src/clipboard.js index 10f2ea9..cdb40d6 100644 --- a/src/clipboard.js +++ b/src/clipboard.js @@ -18,10 +18,6 @@ class Clipboard extends Emitter { constructor(selector, options) { super(); - if (!document.querySelectorAll(selector).length) { - throw new Error('No matches were found for the provided selector'); - } - this.resolveOptions(options); Delegate.bind(document.body, selector, 'click', (e) => this.initialize(e)); diff --git a/test/clipboard.js b/test/clipboard.js index 77e44cf..b943062 100644 --- a/test/clipboard.js +++ b/test/clipboard.js @@ -17,28 +17,6 @@ describe('Clipboard', () => { document.body.innerHTML = ''; }); - describe('#constructor', () => { - it('should throw an error since there was no arguments passed', done => { - try { - new Clipboard(); - } - catch(e) { - assert.equal(e.message, 'No matches were found for the provided selector'); - done(); - } - }); - - it('should throw an error since an empty selector has been passed', done => { - try { - new Clipboard('#abc'); - } - catch(e) { - assert.equal(e.message, 'No matches were found for the provided selector'); - done(); - } - }); - }); - describe('#resolveOptions', function() { it('should set action as a function', () => { var fn = function() {};