Remove web worker test
Ben Alpert committed
May 27, 2015 at 10:52 UTC
12ea09a03c79047adec5b8fe2a7171d066e89e99
4 files changed
+4
-91
Gruntfile.js
+3
-7
@@ -205,17 +205,13 @@ module.exports = function(grunt) {
205
'coverage:parse'
206
]);
207
grunt.registerTask('fasttest', function() {
208
- if (grunt.option('debug')) {
209
- grunt.task.run('build:test', 'connect:server:keepalive');
210
- } else {
211
- grunt.task.run('build:test', 'test:webdriver:phantomjs');
212
- }
208
+ grunt.task.run('test');
209
});
210
grunt.registerTask('test', function() {
211
if (grunt.option('debug')) {
216
- grunt.task.run('build:test', 'build:basic', 'connect:server:keepalive');
212
+ grunt.task.run('build:test', 'connect:server:keepalive');
213
} else {
218
- grunt.task.run('build:test', 'build:basic', 'test:webdriver:phantomjs');
214
+ grunt.task.run('build:test', 'test:webdriver:phantomjs');
215
}
216
});
217
grunt.registerTask('npm:test', ['build', 'npm:pack']);
src/renderers/dom/client/__tests__/ReactWebWorker-test.js
deleted
-44
@@ -1,44 +0,0 @@
1
-/**
2
- * Copyright 2013-2015, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @emails react-core
10
- */
11
-
12
-'use strict';
13
-
14
-describe('ReactWebWorker', function() {
15
- ;(typeof Worker == 'undefined' ? xit : it)('can run React in a web worker', function() {
16
- var done = false;
17
- var error;
18
-
19
- var worker = new Worker(window.ReactWebWorker_URL || '/src/test/worker.js?_=' + Date.now().toString(36));
20
- worker.addEventListener('message', function(e) {
21
- var data = JSON.parse(e.data);
22
- if (data.type == 'error') {
23
- error = data.message + "\n" + data.stack;
24
- done = true;
25
- } else if (data.type == 'log') {
26
- console.log(data.message);
27
- } else {
28
- expect(data.type).toBe('done');
29
- done = true;
30
- }
31
- });
32
-
33
- waitsFor(function() {
34
- return done;
35
- }, "the final message to arrive from the worker", 2e4);
36
-
37
- runs(function() {
38
- if (error) {
39
- console.error(error);
40
- throw new Error(error);
41
- }
42
- });
43
- });
44
-});
src/test/worker.js
deleted
-38
@@ -1,38 +0,0 @@
1
-/* jshint worker: true */
2
-'use strict';
3
-
4
-if (typeof console == 'undefined') {
5
- this.console = {
6
- error: function(e) {
7
- postMessage(JSON.stringify({
8
- type: 'error',
9
- message: e.message,
10
- stack: e.stack
11
- }));
12
- },
13
- log: function(message) {
14
- postMessage(JSON.stringify({
15
- type: 'log',
16
- message: message
17
- }));
18
- }
19
- }
20
-}
21
-
22
-console.log('worker BEGIN');
23
-
24
-// The UMD wrapper tries to store on `global` if `window` isn't available
25
-var global = {};
26
-importScripts("phantomjs-shims.js");
27
-
28
-try {
29
- importScripts("../../build/react.js");
30
-} catch (e) {
31
- console.error(e);
32
-}
33
-
34
-postMessage(JSON.stringify({
35
- type: 'done'
36
-}));
37
-
38
-console.log('worker END');
test/index.html
+1
-2
@@ -19,7 +19,7 @@
19
'the-files-to-test.generated.js',
20
'lib/jasmine-execute.js'
21
];
22
-
22
+
23
if (typeof Function.prototype.bind == 'undefined') {
24
urls.unshift('../node_modules/es5-shim/es5-sham.js');
25
urls.unshift('../node_modules/es5-shim/es5-shim.js');
@@ -32,7 +32,6 @@
32
}
33
34
var base = location.protocol + '//' + location.hostname + ':' + location.port + location.pathname.replace(/^\/?/,'/').split('/').reverse().slice(1).reverse().join('/');
35
- window.ReactWebWorker_URL = base + '/../src/test/worker.js' + cacheBust;
35
36
}());
37
</script>