私の環境ではtestlingさんが無言でおなくなりになることがしばしばです。サンプルではうまくいくので回線の問題ではないようですが、それ以外の原因がわかりません。
$ tar -cf- . | curl -sSNT- -u mail@address.com:pass testling.com/?browsers=iexplore/7.0 Bundling... done iexplore/7.0 0/0 0 % okcurl: (18) transfer closed with outstanding read data remaining
surrogate-pair.jsのテストに使いたかったので3時間ほど費やしてみましたが、解決には至りませんでした。ひとまず試したことをまとめておきます。
ドキュメントを読む
たぶんこの3つがポイント。あと、JavaScriptファイルのcharsetはUTF-8である必要がありそうです。
- テストは
test.js
というファイル名でなければならない - 複数ファイルが必要な場合(requireしている場合)はtarで固める
- 各テストは
t.end()
で終わる必要がある
ちょっと待ってみる
なんか事情があるのかもしれないので待ってみますが、解決しません。
tarをやめてみる
以下のサンプルコードが通る状況で、
# these command will success $ curl -sSNT test.js -u mail@address.com:pass testling.com/?browsers=iexplore/7.0 $ tar -cf- test.js | curl -sSNT- -u mail@address.com:pass testling.com/?browsers=iexplore/7.0
ディレクトリごとtarすると通らなくなることがあります。tarの扱いに難があるのかもしれません。
# this command will fail $ tar -cf- . | curl -sSNT- -u mail@address.com:pass testling.com/?browsers=iexplore/7.0
ローカルで結合してみる
JavaScriptファイルの結合にはnode-browserifyが使われているようなので、これを使ってローカルで結合できるか試してみます。
$ npm install node-browserify testling -g $ browserify test.js -o joined.js Expressions in require() statements: require(__dirname+"/../selectors/index") node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: No wrapper for core module sys at Function.<anonymous> (/usr/lib/node_modules/browserify/lib/wrap.js:317:19) at Function.require (/usr/lib/node_modules/browserify/index.js:151:28) at /usr/lib/node_modules/browserify/lib/wrap.js:411:14 at Array.forEach (native) at Function.<anonymous> (/usr/lib/node_modules/browserify/lib/wrap.js:410:27) at Function.require (/usr/lib/node_modules/browserify/index.js:151:28) at /usr/lib/node_modules/browserify/lib/wrap.js:411:14 at Array.forEach (native) at Function.<anonymous> (/usr/lib/node_modules/browserify/lib/wrap.js:410:27) at Function.require (/usr/lib/node_modules/browserify/index.js:151:28)
ローカルでテストしてみる
ドキュメントに従ってローカルでテストしてみます。……が、公式サイトに載っているサンプルコードさえ通りませんでした。t.log()があるとダメなようです。
$ npm install testling -g $ testling test.js node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Object function (name, cb) { if (typeof name === 'function') { cb = name; name = undefined; } var t = new Test(name, test.push); pending ++; t.on('testEnd', function () { pending --; process.nextTick(function () { if (pending <= 0) t.push('end', {}); harness.emit('end', t); }); }); cb(t); } has no method 'output' at Function.<anonymous> (/usr/lib/node_modules/testling/lib/run.js:19:18) at Function.<anonymous> (/usr/lib/node_modules/testling/node_modules/seq/index.js:447:24) at Function.<anonymous> (/usr/lib/node_modules/testling/node_modules/seq/index.js:210:38) at action (/usr/lib/node_modules/testling/node_modules/seq/index.js:76:11) at Function.next (/usr/lib/node_modules/testling/node_modules/seq/index.js:208:17) at native at Function.<anonymous> (/usr/lib/node_modules/testling/node_modules/seq/index.js:216:25) at Function.<anonymou
私のnodeがちょっと古いのかもしれません。後日これを更新してみます。