$sudo npm install -g testem でtestemをインストールし、例として以下のようにディレクトリとファイルを作る (jasmineのインストールは不要) [kt]$ tree . ├── scripts │ └── myfunc.js ├── testem.json └── tests └── test-myfunc.js //myfunc.js //関数 function x10(v){ return 10 * v; } //testem.json //設定ファイル { "framework" : "jasmine", "src_files" : [ "scripts/myfunc.js", "tests/test-myfunc.js" ] } //test-myfunc.js //ユニットテスト describe("x10 test", function()
![testem + jasmineでJSのユニットテスト - peroon's diary](https://cdn-ak-scissors.b.st-hatena.com/image/square/2c8b9cd2ed4235b1914ada46aa2b9853cdd398e5/height=288;version=1;width=512/http%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fp%2Fperoon%2F20130901%2F20130901161617.jpg)