@samitouri / QOS-React-2 / commits / 7108c8a624

Fixed failing unit tests in browsers that don't support WebComponents

Jim committed May 20, 2015 at 18:34 UTC 7108c8a62442a6823c93968c53502abd0a2de1b7
2 files changed +8 -3
src/renderers/dom/client/__tests__/ReactMount-test.js
+7 -3
@@ -17,12 +17,16 @@ describe('ReactMount', function() {
17 var React = require('React');
18 var ReactMount = require('ReactMount');
19 var ReactTestUtils = require('ReactTestUtils');
20 - var WebComponents = undefined;
20 + var WebComponents = WebComponents;
21
22 try {
23 - WebComponents = require('WebComponents');
23 + if (WebComponents === undefined && jest !== undefined) {
24 + WebComponents = require('WebComponents');
25 + }
26 } catch(e) {
25 - /* leave WebComponents undefined */
27 + // Parse error expected on engines that don't support setters
28 + // or otherwise aren't supportable by the polyfill.
29 + // Leave WebComponents undefined.
30 }
31
32 describe('constructAndRenderComponentByID', function() {
test/index.html
+1
@@ -5,6 +5,7 @@
5 ;(function(){
6
7 var urls = [
8 + '../src/shared/vendor/third_party/webcomponents.js',
9 '../vendor/jasmine/jasmine.js',
10 '../vendor/jasmine/jasmine-support.js',
11 '../vendor/jasmine/jasmine-html.js',