Created
May 19, 2012 06:06
-
-
Save kyo-ago/2729537 to your computer and use it in GitHub Desktop.
jstestdriver.conf sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Jenkinsの「シェルスクリプト」に記述するコマンド例 | |
#--serverで指定しているポート番号は「java -jar JsTestDriver[バージョン番号].jar --port 9876」で指定した内容を記述します。 | |
#--resetは毎回ファイルを読み込み直すため安定した実行が期待できますが、実行時間が長くなるのと、普段(プログラマが行う状態)のテストと状態が異なる可能性があるので、問題が発生した場合は外してみてください。 | |
[javaのパス]java -jar [JsTestDriverのパス]JsTestDriver[バージョン番号].jar --server "http://localhost:9876" --config [テストコードのパス]jstestdriver.conf --tests all --testOutput [適当に空ディレクトリのパス]testOutput/ --reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#h1. このファイルに関して | |
#書式はyamlなのでコメント等が書けます。 | |
#各種ファイルパスはこのファイルからの相対値です(コマンドラインで変更可能) | |
# 各種ファイルは以下のディレクトリ形式で保存されている想定です。 | |
# js/*.js アプリケーションコード | |
# js/lib/*.js ライブラリコード | |
# js/t/*.js テストコード | |
# js/t/jstestdriver.conf このファイル | |
#h1. 各種設定に関して | |
#h2. ファイルパスの基準値を変更 | |
basepath: ../ | |
#h2. テスト実行前に読み込むファイル | |
#テスト対象のファイルを指定します | |
load: | |
- t/sinon.js | |
- lib/*.js | |
- *.js | |
#h2. 除外したいファイルがある場合、以下の形式で除外(まだ動かないテストとか) | |
# exclude: | |
# - t/exclude.js | |
#h2. テストコードの指定 | |
test: | |
- t/*.js | |
#h2. タイムアウト | |
#初期値の90秒は非同期処理に失敗した場合等にエラーになるまで長いので10秒程度を推奨 | |
#ただし、テスト全体のタイムアウトなので複数台のスマートフォンでテストを実行する場合、10秒では短い可能性があります。その場合適時長くしてください。 | |
timeout: 10 | |
#h2. コードカバレッジ(テストがどの程度の行数をカバーしているか)の取得 | |
#coverage.jarはjstestdriver.jarをダウンロードしたページと同じ場所( http://code.google.com/p/js-test-driver/downloads/list )からダウンロードできます。 | |
#argsは http://code.google.com/p/js-test-driver/wiki/CodeCoverage のコメントに記述があるのですが、実際試してないので推測です(WebStormでcoverageを取得しないファイルを複数指定できるので、方法があるのは確か) | |
#コードカバレッジを取得するにはコマンドラインから「--testOutput outputDirectory」を指定する必要があります。 | |
#plugin: | |
# - name: "coverage" | |
# jar: "coverage.jar" | |
# module: "com.google.jstestdriver.coverage.CoverageModule" | |
# args: "coverageを取得しないファイルパスを,区切りで記述" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment