Upgrade to Pro — share decks privately, control downloads, hide ads and more …

大阪Node学園四時限目 "This crazy testless world"

大阪Node学園四時限目 "This crazy testless world"

大阪Node学園四時限目 "This crazy testless world" のスライドを少し手直ししたものです。

testacularとtestemのconfigファイルを追記しました。

Shunsuke Watanabe

November 24, 2012
Tweet

More Decks by Shunsuke Watanabe

Other Decks in Programming

Transcript

  1. Make sure you have node 0.8.x or above “npm install

    ­g testacular; npm ln testacular” Make a config file named “testacular.conf.js” Setup mocha and expect.js (or chai.js) Specify browsers to run tests Run “testacular start” and you're good to go.
  2. testacular.conf.js X 1 basePath = './'; 2 3 files =

    [ 4 MOCHA, 5 MOCHA_ADAPTER, 6 './node_modules/expect.js/expect.js', 7 'specs/**/*.js' 8 ]; 9 10 exclude = [ 11 12 ]; 13 14 reporters = ['progress']; 15 16 port = 8080; 17 18 runnerPort = 9100; 19 20 colors = true; 21 22 // level of logging 23 // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG 24 logLevel = LOG_INFO; 25 26 autoWatch = true; 27 28 browsers = ['Firefox']; 29 30 captureTimeout = 5000; 31 32 // Continuous Integration mode 33 // if true, it capture browsers, run tests and exit 34 singleRun = false;
  3. Make sure you have node 0.6.2 or above “npm install

    ­g testem; npm ln testem” Make a config file named “testem.js” Setup mocha and expect.js (or chai.js) Specify browsers to run tests Run “testem” and you're good to go.
  4. testem.json 1 { 2 "framework": "mocha", 3 "src_files": [ 4

    "./node_modules/expect.js/expect.js", 5 "specs/**/*.js"], 6 "launch_in_dev":[ 7 "Chrome" 8 ] 9 } ~ ~
  5. Use AngularJS e2e Test Runner Git clone https://github.com/angular/angular­phonecat.git Copy test/e2e

    directory and test/lib/angular/angular­ scenario.js to your public directory. Open e2e/runner.html on a browser. And you're good to go.