1
這裏是我的Gruntfile:將測試日誌保存到磁盤?
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mochaTest: {
test: {
options: {
reporter: 'spec',
clearRequireCache: true,
require: ['./index.js']
},
src: ['test/**/*.coffee']
},
report: {
options: {
reporter: 'markdown',
clearRequireCache: true,
require: ['./index.js']
},
src: ['test/**/*.coffee'],
dest: './FEATURES.md'
}
},
watch: {
test: {
options: {
spawn: false,
},
files: ['src/**/*.coffee', 'test/**/*.coffee'],
tasks: ['coffee:main', 'mochaTest']
}
},
coffee: {
main: {
options: {
bare: true
},
files: [{
expand: true,
cwd: "./src",
src: ["**/*.coffee"],
dest: "./lib",
ext: ".js"
}]
},
}
});
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha-test');
// Default task(s).
grunt.registerTask('default', ['coffee:main', 'mochaTest:test', 'watch']);
grunt.registerTask('test', ['coffee:main', 'mochaTest:test']);
grunt.registerTask('report', ['coffee:main', 'mochaTest:report']);
};
當我運行grunt
對其進行測試,並報告手錶作爲規範,但是當我運行grunt report
它告訴我在降價的輸出,雖然沒有文件在項目的根目錄中創建。是否有可能讓markdown記者在代碼標籤中輸出coffeescript而不是js?有沒有辦法通過y代碼刪除任何記錄的輸出?
非常感謝。最高的問題。有沒有辦法輸出咖啡?* – Vinz243 2014-09-24 10:33:30
你想用** mochaTest **輸出'coffee'而不是'markdown',或者這是你想要實現的東西嗎? – 2014-09-24 10:35:21
GH圍欄代碼之間的輸出代碼爲js。我想在咖啡:) – Vinz243 2014-09-24 10:36:16