jasmine-pretty-html-reporter
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -6,3 +6,3 @@ { | ||
"main": "index.js", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"keywords": ["jasmine", "pretty", "html", "reporter"], | ||
@@ -9,0 +9,0 @@ "repository": { |
# jasmine pretty html reporter | ||
``` | ||
npm i jasmine-pretty-html-reporter --save-dev | ||
``` | ||
_NOTE: jasmine is set as a peer dependency_ | ||
### Basic Setup | ||
``` | ||
@@ -11,2 +18,3 @@ var Jasmine = require('jasmine'); | ||
// options object | ||
jasmine.addReporter(new HtmlReporter({ | ||
@@ -17,2 +25,4 @@ path: path.join(__dirname,'results') | ||
jasmine.execute(); | ||
``` | ||
``` | ||
### Results |
@@ -6,4 +6,7 @@ 'use strict'; | ||
//path setup | ||
const templatePath = path.join(__dirname, 'report.html'); | ||
const fileContents = fs.readFileSync(templatePath).toString(); | ||
class Reporter { | ||
constructor(options) { | ||
@@ -18,2 +21,3 @@ this.options = options; | ||
this.destination = path.join(this.options.path, 'report.html'); | ||
} | ||
@@ -26,7 +30,5 @@ | ||
jasmineStarted(suiteInfo) { | ||
//this._sequence.push(suiteInfo); | ||
}; | ||
suiteStarted(result) { | ||
//this._sequence.push(result); | ||
}; | ||
@@ -36,3 +38,2 @@ | ||
this._start = this.nowString(); | ||
//this._sequence.push(result); | ||
}; | ||
@@ -45,9 +46,3 @@ | ||
this._counts[result.status] = (this._counts[result.status] || 0) + 1; | ||
}; | ||
suiteDone(result) { | ||
//this._sequence.push(result); | ||
}; | ||
jasmineDone() { | ||
let logEntry = { | ||
@@ -58,9 +53,10 @@ sequence: this._sequence, | ||
let templatePath = path.join(__dirname, 'report.html'); | ||
let destination = path.join(this.options.path, 'report.html'); | ||
let fileContents = fs.readFileSync(templatePath).toString(); | ||
let results = fileContents.replace('\'<Results Replacement>\'', JSON.stringify(logEntry, null, 4)); | ||
fs.writeFileSync(this.destination, results, 'utf8'); | ||
}; | ||
fileContents = fileContents.replace('\'<Results Replacement>\'', JSON.stringify(logEntry, null, 4)); | ||
suiteDone(result) { | ||
}; | ||
fs.writeFileSync(destination, fileContents, 'utf8'); | ||
jasmineDone() { | ||
}; | ||
@@ -67,0 +63,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26
9201
46