mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Remove web worker test
This commit is contained in:
+3
-7
@@ -205,19 +205,15 @@ module.exports = function(grunt) {
|
||||
'coverage:parse'
|
||||
]);
|
||||
grunt.registerTask('fasttest', function() {
|
||||
grunt.task.run('test');
|
||||
});
|
||||
grunt.registerTask('test', function() {
|
||||
if (grunt.option('debug')) {
|
||||
grunt.task.run('build:test', 'connect:server:keepalive');
|
||||
} else {
|
||||
grunt.task.run('build:test', 'test:webdriver:phantomjs');
|
||||
}
|
||||
});
|
||||
grunt.registerTask('test', function() {
|
||||
if (grunt.option('debug')) {
|
||||
grunt.task.run('build:test', 'build:basic', 'connect:server:keepalive');
|
||||
} else {
|
||||
grunt.task.run('build:test', 'build:basic', 'test:webdriver:phantomjs');
|
||||
}
|
||||
});
|
||||
grunt.registerTask('npm:test', ['build', 'npm:pack']);
|
||||
|
||||
// Optimized build task that does all of our builds. The subtasks will be run
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
/**
|
||||
* Copyright 2013-2015, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @emails react-core
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
describe('ReactWebWorker', function() {
|
||||
;(typeof Worker == 'undefined' ? xit : it)('can run React in a web worker', function() {
|
||||
var done = false;
|
||||
var error;
|
||||
|
||||
var worker = new Worker(window.ReactWebWorker_URL || '/src/test/worker.js?_=' + Date.now().toString(36));
|
||||
worker.addEventListener('message', function(e) {
|
||||
var data = JSON.parse(e.data);
|
||||
if (data.type == 'error') {
|
||||
error = data.message + "\n" + data.stack;
|
||||
done = true;
|
||||
} else if (data.type == 'log') {
|
||||
console.log(data.message);
|
||||
} else {
|
||||
expect(data.type).toBe('done');
|
||||
done = true;
|
||||
}
|
||||
});
|
||||
|
||||
waitsFor(function() {
|
||||
return done;
|
||||
}, "the final message to arrive from the worker", 2e4);
|
||||
|
||||
runs(function() {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,38 +0,0 @@
|
||||
/* jshint worker: true */
|
||||
'use strict';
|
||||
|
||||
if (typeof console == 'undefined') {
|
||||
this.console = {
|
||||
error: function(e) {
|
||||
postMessage(JSON.stringify({
|
||||
type: 'error',
|
||||
message: e.message,
|
||||
stack: e.stack
|
||||
}));
|
||||
},
|
||||
log: function(message) {
|
||||
postMessage(JSON.stringify({
|
||||
type: 'log',
|
||||
message: message
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log('worker BEGIN');
|
||||
|
||||
// The UMD wrapper tries to store on `global` if `window` isn't available
|
||||
var global = {};
|
||||
importScripts("phantomjs-shims.js");
|
||||
|
||||
try {
|
||||
importScripts("../../build/react.js");
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
postMessage(JSON.stringify({
|
||||
type: 'done'
|
||||
}));
|
||||
|
||||
console.log('worker END');
|
||||
+1
-2
@@ -19,7 +19,7 @@
|
||||
'the-files-to-test.generated.js',
|
||||
'lib/jasmine-execute.js'
|
||||
];
|
||||
|
||||
|
||||
if (typeof Function.prototype.bind == 'undefined') {
|
||||
urls.unshift('../node_modules/es5-shim/es5-sham.js');
|
||||
urls.unshift('../node_modules/es5-shim/es5-shim.js');
|
||||
@@ -32,7 +32,6 @@
|
||||
}
|
||||
|
||||
var base = location.protocol + '//' + location.hostname + ':' + location.port + location.pathname.replace(/^\/?/,'/').split('/').reverse().slice(1).reverse().join('/');
|
||||
window.ReactWebWorker_URL = base + '/../src/test/worker.js' + cacheBust;
|
||||
|
||||
}());
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user