-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser testing #451
Browser testing #451
Conversation
|
||
module.exports = function() { | ||
var config = this.data; | ||
var done = this.async(); | ||
|
||
var theFilesToTestScript = fs.createWriteStream(__dirname + '/../../test/the files to test.generated.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How confident are we about spaces in file names? I'd be tempted to just use underscores here.
It's not passing every browser in testling-ci yet. I'm investigating. |
@@ -6,7 +6,7 @@ var global = {}; | |||
importScripts("phantomjs-shims.js"); | |||
|
|||
try { | |||
importScripts("react.js"); | |||
importScripts("../../build/react.js"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this requires us to run grunt build
before grunt test
, so that build/react.js
will be built. Wondering if we should make grunt test
depend on grunt build
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not 100% sure about this change. I did it so that I could get the tests running in a browser normally without having to rely on the phantomjs web server contortions.
Can we not expect Testling-CI to run |
var done = false; | ||
var error; | ||
|
||
var worker = new Worker('/worker.js'); | ||
var worker = new Worker(window.ReactWebWorker_URL || '/src/test/worker.js?_=' + Date.now().toString(36)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @spicyj who last worked with ReactWebWorker-test
: thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong feelings, I was expecting someone to want to change the generic path earlier than now. Can we not just use a relative path here though? I think I'm actually just missing context on the purpose of this PR.
I don't know how to get testling-ci to run grunt. |
return a.pathname; | ||
}()); | ||
|
||
var __dirname = __filename.split('/').reverse().slice(1).reverse().join('/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you've got your own scope here, why not just
var parts = __filename.split('/');
parts.pop();
var __dirname = parts.join('/');
@subtleGradient can you look into why Travis CI tests are failing? Looks like something to do with |
@benjamn looking into it now… |
document.write('<script src="' + __dirname + '/../test/the-files-to-test.generated.js' + cacheBust + '"><\/script>'); | ||
document.write('<script src="' + __dirname + '/../test/jasmine-execute.js' + cacheBust + '"><\/script>'); | ||
|
||
}()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I see the point in making this a dynamic JS file instead of generating a simple HTML file. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testling-ci can load scripts like this, but it won't load an html file.
Got testling-ci working with IE10 and probably more. |
Switching to SauceLabs… |
👍 looks legit |
The |
@@ -0,0 +1,37 @@ | |||
;(function(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get rid of this file if we're using SauceLabs instead of Testling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still want to get rid of this file if possible.
I decided to remove testling and sauce labs as dependencies for this PR. I'll add sauce labs support in a separate PR. |
Not necessary now that we aren't supporting testling.
grunt.loadNpmTasks('grunt-compare-size'); | ||
grunt.loadNpmTasks('grunt-contrib-compress'); | ||
for (var key in grunt.file.readJSON("package.json").devDependencies) { | ||
if (key !== "grunt" && key.indexOf("grunt") === 0) grunt.loadNpmTasks(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just if (key.indexOf("grunt-") === 0) grunt.loadNpmTasks(key);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just pasted this from somewhere. Dang my slackerly ways!
Running the tests shouldn't make git status dirty.
Looking great! My final request is to make |
You can run tests in a local browser by opening the I'm not sure how to make it so that |
This is what I've been doing to test changes really quickly…
If you also want to test changes to any of the generated files you'll need to rebuild them as necessary with [1] Any webdriver server running on [2] To keep the browser window open, pass the |
No description provided.