Gruntfile.coffee
jade = require "jade"
module.exports = (grunt) =>
grunt.initConfig
jasmine:
files: [
"public/js/lib/zepto.min.js"
"public/js/main.js"
...(依存ライブラリとテスト対象)
]
options:
specs: [
"test/js/mainSpec.js"
....(実行したいテスト)
]
template:
process: (grunt, task, contest) ->
tt = "test/template.jade"
src = grunt.file.read tt
compiled = jade.compile(src, {pretty:true, filename:tt})(context)
outfile: "test/js/_SpecRunner.html"
keepRunner: true
test/template.jade
!!!
html
head
meta(charset="utf8")
// 順番が重要
jss = [scripts.jasmine, scripts.vendor, scripts.helpers, scripts.src, scripts.specs, scripts.reporters, scripts.start]
for js in jss
for path in js
script(type="text/javascript", src=path)
body
...(テストに必要なHTMLをinclude, mixinで書く)