Skip to content
Browse files

fix for output race condition

  • Loading branch information...
1 parent d4707f9 commit cdf7efb9b8e55545aaf35de0be16fe609f79a020 @substack committed Nov 4, 2011
Showing with 24 additions and 20 deletions.
  1. +2 −0 bin/cli.js
  2. +21 −19 lib/run.js
  3. +1 −1 package.json
View
2 bin/cli.js
@@ -1,6 +1,8 @@
#!/usr/bin/env node
var http = require('http');
+var testling = require('testling'); // sets up the test output
+
var runner = require('../lib/run');
var testFiles = require('../lib/test_files');
var streamFiles = require('../lib/stream_files');
View
40 lib/run.js
@@ -5,23 +5,25 @@ var seq = require('seq');
var test = require('../lib/test');
module.exports = function (files) {
- seq(files).seqEach_(function (next, file) {
- test.browser = file;
- test.harness.once('end', function () {
- process.nextTick(next.ok)
- });
-
- try {
- require(path.resolve(process.cwd(), file));
- }
- catch (err) {
- console.log('');
- test.output('visit', file);
- test.output('launched', file);
- var lines = (err && err.stack || err).split(/\r?\n/);
- console.error('\r\n ' + lines.slice(0,-7).join('\r\n') + '\r\n');
-
- next();
- }
- });
+ seq(files).seqEach_(run);
};
+
+function run (next, file) {
+ test.browser = file;
+ test.harness.once('end', function () {
+ process.nextTick(next.ok)
+ });
+
+ try {
+ require(path.resolve(process.cwd(), file));
+ }
+ catch (err) {
+ console.log('');
+ test.output('visit', file);
+ test.output('launched', file);
+ var lines = (err && err.stack || err).split(/\r?\n/);
+ console.error('\r\n ' + lines.slice(0,-7).join('\r\n') + '\r\n');
+
+ next();
+ }
+}
View
2 package.json
@@ -1,7 +1,7 @@
{
"name" : "testling",
"description" : "run testling tests headlessly and remotely on real browsers",
- "version" : "0.0.0",
+ "version" : "0.0.1",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/testling.git"

0 comments on commit cdf7efb

Please sign in to comment.
Something went wrong with that request. Please try again.