html-reporter
Advanced tools
Comparing version 2.9.3 to 2.10.0
@@ -5,2 +5,17 @@ # Change Log | ||
<a name="2.10.0"></a> | ||
# [2.10.0](https://github.com/gemini-testing/html-reporter/compare/v2.9.3...v2.10.0) (2018-04-04) | ||
### Bug Fixes | ||
* **hack:** do not close connection on event source error ([376b88a](https://github.com/gemini-testing/html-reporter/commit/376b88a)) | ||
### Features | ||
* save data file on process exit ([bb36c00](https://github.com/gemini-testing/html-reporter/commit/bb36c00)) | ||
<a name="2.9.3"></a> | ||
@@ -7,0 +22,0 @@ ## [2.9.3](https://github.com/gemini-testing/html-reporter/compare/v2.9.2...v2.9.3) (2018-04-01) |
@@ -8,2 +8,6 @@ 'use strict'; | ||
module.exports = class App { | ||
static create(paths, tool, configs) { | ||
return new this(paths, tool, configs); | ||
} | ||
constructor(paths, tool, configs) { | ||
@@ -22,2 +26,6 @@ const {program} = configs; | ||
finalize() { | ||
this._tool.finalize(); | ||
} | ||
run(tests) { | ||
@@ -24,0 +32,0 @@ return _.isEmpty(tests) |
@@ -10,5 +10,7 @@ 'use strict'; | ||
const {MAX_REQUEST_SIZE} = require('./constants/server'); | ||
const {logger} = require('../server-utils'); | ||
exports.start = (paths, tool, configs) => { | ||
const app = new App(paths, tool, configs); | ||
const {options, pluginConfig} = configs; | ||
const app = App.create(paths, tool, configs); | ||
const server = express(); | ||
@@ -18,3 +20,3 @@ | ||
server.use(express.static(path.join(__dirname, '../static'), {index: 'gui.html'})); | ||
server.use('/images', express.static(path.join(process.cwd(), configs.pluginConfig.path, 'images'))); | ||
server.use('/images', express.static(path.join(process.cwd(), pluginConfig.path, 'images'))); | ||
@@ -48,5 +50,7 @@ server.get('/', (req, res) => res.sendFile(path.join(__dirname, '../static', 'gui.html'))); | ||
onExit(() => console.log('server shutting down')); | ||
onExit(() => { | ||
app.finalize(); | ||
logger.log('server shutting down'); | ||
}); | ||
const {options} = configs; | ||
return app.initialize() | ||
@@ -53,0 +57,0 @@ .then(() => { |
@@ -44,2 +44,6 @@ 'use strict'; | ||
finalize() { | ||
this._reportBuilder.saveDataFileSync(); | ||
} | ||
addClient(connection) { | ||
@@ -46,0 +50,0 @@ this._eventSource.addConnection(connection); |
@@ -155,7 +155,5 @@ 'use strict'; | ||
save() { | ||
const reportDir = this._pluginConfig.path; | ||
return fs.mkdirsAsync(reportDir) | ||
return fs.mkdirsAsync(this._pluginConfig.path) | ||
.then(() => Promise.all([ | ||
fs.writeFileAsync(path.join(reportDir, 'data.js'), this._prepareData(), 'utf8'), | ||
this.saveDataFileAsync(), | ||
this._copyToReportDir(['index.html', 'report.min.js', 'report.min.css']) | ||
@@ -167,2 +165,14 @@ ])) | ||
saveDataFileAsync() { | ||
return this._saveDataFile(fs.writeFileAsync); | ||
} | ||
saveDataFileSync() { | ||
return this._saveDataFile(fs.writeFileSync); | ||
} | ||
_saveDataFile(saveFn) { | ||
return saveFn(path.join(this._pluginConfig.path, 'data.js'), this._prepareData(), 'utf8'); | ||
} | ||
_prepareData() { | ||
@@ -169,0 +179,0 @@ const data = this.getResult(); |
@@ -49,7 +49,2 @@ 'use strict'; | ||
}); | ||
eventSource.onerror = () => { | ||
console.error('Seems like servers went down. Closing connection...'); | ||
eventSource.close(); | ||
}; | ||
} | ||
@@ -56,0 +51,0 @@ |
{ | ||
"name": "html-reporter", | ||
"version": "2.9.3", | ||
"version": "2.10.0", | ||
"description": "Plugin for gemini and hermione which is intended to aggregate the results of tests running into html report", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
6371360
91
7314
1