0
独自のプロセスでいくつかのテストを実行し、何とかistanbulレポートを結合したいと考えています。例えば複数のスクリプト(または組み合わせたカバレッジレポート)の単一のistanbulコマンド
、2つの実装:
//sut1.js
'use strict'
module.exports = function() {
return 42
}
と
//sut2.js
'use strict'
module.exports = function() {
return '42'
}
と二つの試験:
//test1.js
'use strict'
const expect = require('chai').expect
const sut1 = require('./sut1.js')
expect(sut1()).to.equal(42)
expect(sut1()).not.to.equal('42')
console.log('looks good')
と:
//test2.js
'use strict'
const expect = require('chai').expect
const sut2 = require('./sut2.js')
describe('our other function', function() {
it('should give you a string', function() {
expect(sut2()).to.equal('42')
})
it('should not give a a number', function() {
expect(sut2()).not.to.equal(42)
})
})
私はこのようなどちらか一方のカバレッジレポートを取得することができ
:
istanbul cover --print both test1.js
istanbul cover --print both -- node_modules/mocha/bin/_mocha test2.js
複合カバレッジレポートを取得する最も簡単な方法は何ですか?それを出力するライナーは1つありますか?
モカまたはジャスミンを使用すると、複数のファイルを渡すことができますが、ここでは実際には別のスクリプトを実行します。