Teaspoon is working showing my tests with Mocha in: localhost:3000/teaspoon/default
I read that I can use Istanbul with Teaspoon for code coverage reports.
I installed with npm istanbul, but I don't know how to run it with teaspoon.
I would like to reach my coverage in localhost:3000/coverage or localhost:3000/teaspoon/default/coverage
What is the configuration? I tried the default one in Teaspoon but is not working:
Teaspoon.setup do |config|
# Coverage (requires istanbul -- https://github.com/gotwarlost/istanbul)
config.coverage = true
config.coverage_reports = ['text', 'html', 'cobertura']
config.coverage_output_dir = "coverage"
config.statements_coverage_threshold = 50
config.functions_coverage_threshold = 50
config.branches_coverage_threshold = 50
config.lines_coverage_threshold = 50
end
This configuration is working for me:
Teaspoon.configure do |config|
config.mount_at = "/teaspoon"
config.suite do |suite|
suite.use_framework :mocha
suite.javascripts += ["support/expect"]
end
config.formatters = ["tap"]
config.color = true
config.use_coverage = :default
config.coverage do |coverage|
coverage.reports = ["html", "cobertura"]
coverage.output_path = "coverage"
end
end