Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jasmine-pretty-html-reporter

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-pretty-html-reporter - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc