Socket
Socket
Sign inDemoInstall

@cucumber/html-formatter

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cucumber/html-formatter - npm Package Compare versions

Comparing version 18.0.0 to 19.0.0

.eslintrc.json

12

.mocharc.json
{
"require": ["tsconfig-paths/register", "ts-node/register", "source-map-support/register"],
"extension": ["ts", "tsx"],
"require": [
"ts-node/register",
"source-map-support/register"
],
"extension": [
"ts",
"tsx"
],
"recursive": true,
"timeout": 10000
}
}

@@ -15,4 +15,5 @@ /*

/*!
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
* Font Awesome Free 6.1.0 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2022 Fonticons, Inc.
*/

@@ -19,0 +20,0 @@

{
"name": "@cucumber/html-formatter",
"version": "18.0.0",
"version": "19.0.0",
"description": "HTML formatter for Cucumber",
"bin": {
"cucumber-html-formatter": "bin/cucumber-html-formatter.js"
},
"main": "dist/src/CucumberHtmlStream.js",

@@ -17,36 +14,58 @@ "types": "dist/src/CucumberHtmlStream.d.ts",

"scripts": {
"prepare": "cpy '**/*.scss' '../dist/src' --cwd='src' --parents",
"test": "mocha",
"prepublishOnly": "tsc --build tsconfig.build.json"
"clean": "shx rm -rf dist",
"build:tsc": "tsc --build tsconfig.build.json",
"build:webpack": "webpack",
"build": "npm run clean && npm run build:tsc && npm run prepare && npm run build:webpack",
"prepare": "shx mkdir -p dist/src && shx cp src/*.scss dist/src && shx cp src/index.mustache.html dist/src",
"test": "mocha --exclude test/acceptance.ts",
"prepublishOnly": "npm run build",
"eslint:fix": "eslint --ext ts,tsx --max-warnings 0 --fix src test",
"eslint": "eslint --ext ts,tsx --max-warnings 0 src test",
"validate": "mocha test/acceptance.ts"
},
"dependencies": {
"@cucumber/messages": "^17.1.1",
"commander": "8.3.0",
"source-map-support": "0.5.21"
"peerDependencies": {
"@cucumber/messages": ">=17"
},
"devDependencies": {
"@babel/core": "7.16.12",
"@cucumber/gherkin-streams": "^4.0.0",
"@babel/core": "7.17.8",
"@cucumber/compatibility-kit": "^9.1.2",
"@cucumber/gherkin": "22.0.0",
"@cucumber/gherkin-streams": "^5.0.0",
"@cucumber/gherkin-utils": "^7.0.0",
"@cucumber/message-streams": "^3.0.0",
"@cucumber/message-streams": "^4.0.0",
"@cucumber/messages": "^17.1.1",
"@cucumber/query": "^11.0.0",
"@cucumber/react": "^19.0.0",
"@cucumber/react": "^19.2.0",
"@types/glob": "^7.2.0",
"@types/mocha": "9.1.0",
"@types/node": "16.11.21",
"@types/react": "17.0.38",
"@types/react-dom": "17.0.11",
"babel-loader": "8.2.3",
"cpy-cli": "3.1.1",
"css-loader": "6.5.1",
"mini-css-extract-plugin": "2.5.3",
"mocha": "9.2.0",
"@types/node": "16.11.26",
"@types/react": "17.0.41",
"@types/react-dom": "17.0.14",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"babel-loader": "8.2.4",
"css-loader": "6.7.1",
"eslint": "^8.7.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"glob": "^7.2.0",
"mini-css-extract-plugin": "2.6.0",
"mocha": "9.2.2",
"prettier": "^2.5.1",
"puppeteer": "^13.1.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"sass": "1.49.0",
"sass-loader": "12.4.0",
"ts-loader": "9.2.6",
"ts-node": "10.4.0",
"typescript": "4.5.5",
"webpack": "5.67.0",
"sass": "1.49.9",
"sass-loader": "12.6.0",
"shx": "^0.3.4",
"source-map-support": "0.5.21",
"ts-loader": "9.2.8",
"ts-node": "10.7.0",
"typescript": "4.6.2",
"webpack": "5.70.0",
"webpack-cli": "4.9.2"

@@ -53,0 +72,0 @@ },

/// <reference types="node" />
import * as messages from '@cucumber/messages';
import { Transform, TransformCallback } from 'stream';
import * as messages from '@cucumber/messages';
export default class CucumberHtmlStream extends Transform {

@@ -5,0 +5,0 @@ private readonly cssPath;

@@ -80,2 +80,4 @@ "use strict";

return callback(err);
if (!template)
return callback(new Error('template is required if error is missing'));
const beginIndex = begin == null ? 0 : template.indexOf(begin) + begin.length;

@@ -82,0 +84,0 @@ const endIndex = end == null ? template.length : template.indexOf(end);

@@ -0,3 +1,3 @@

import './styles.scss';
import * as messages from '@cucumber/messages';
import './styles.scss';
declare global {

@@ -4,0 +4,0 @@ interface Window {

@@ -6,6 +6,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
require("./styles.scss");
const react_1 = require("@cucumber/react");
const react_2 = __importDefault(require("react"));
const react_dom_1 = __importDefault(require("react-dom"));
require("./styles.scss");
const { CucumberReact } = react_1.components;

@@ -12,0 +12,0 @@ const { FilteredResults, EnvelopesWrapper, SearchWrapper } = react_1.components.app;

@@ -15,5 +15,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
const stream_1 = require("stream");
const CucumberHtmlStream_1 = __importDefault(require("../src/CucumberHtmlStream"));
const stream_1 = require("stream");
const assert_1 = __importDefault(require("assert"));
function renderAsHtml(...envelopes) {

@@ -24,3 +24,3 @@ return __awaiter(this, void 0, void 0, function* () {

const sink = new stream_1.Writable({
write(chunk, encoding, callback) {
write(chunk, _, callback) {
html += chunk;

@@ -27,0 +27,0 @@ callback();

{
"name": "@cucumber/html-formatter",
"version": "18.0.0",
"version": "19.0.0",
"description": "HTML formatter for Cucumber",
"bin": {
"cucumber-html-formatter": "bin/cucumber-html-formatter.js"
},
"main": "dist/src/CucumberHtmlStream.js",

@@ -17,36 +14,58 @@ "types": "dist/src/CucumberHtmlStream.d.ts",

"scripts": {
"prepare": "cpy '**/*.scss' '../dist/src' --cwd='src' --parents",
"test": "mocha",
"prepublishOnly": "tsc --build tsconfig.build.json"
"clean": "shx rm -rf dist",
"build:tsc": "tsc --build tsconfig.build.json",
"build:webpack": "webpack",
"build": "npm run clean && npm run build:tsc && npm run prepare && npm run build:webpack",
"prepare": "shx mkdir -p dist/src && shx cp src/*.scss dist/src && shx cp src/index.mustache.html dist/src",
"test": "mocha --exclude test/acceptance.ts",
"prepublishOnly": "npm run build",
"eslint:fix": "eslint --ext ts,tsx --max-warnings 0 --fix src test",
"eslint": "eslint --ext ts,tsx --max-warnings 0 src test",
"validate": "mocha test/acceptance.ts"
},
"dependencies": {
"@cucumber/messages": "^17.1.1",
"commander": "8.3.0",
"source-map-support": "0.5.21"
"peerDependencies": {
"@cucumber/messages": ">=17"
},
"devDependencies": {
"@babel/core": "7.16.12",
"@cucumber/gherkin-streams": "^4.0.0",
"@babel/core": "7.17.8",
"@cucumber/compatibility-kit": "^9.1.2",
"@cucumber/gherkin": "22.0.0",
"@cucumber/gherkin-streams": "^5.0.0",
"@cucumber/gherkin-utils": "^7.0.0",
"@cucumber/message-streams": "^3.0.0",
"@cucumber/message-streams": "^4.0.0",
"@cucumber/messages": "^17.1.1",
"@cucumber/query": "^11.0.0",
"@cucumber/react": "^19.0.0",
"@cucumber/react": "^19.2.0",
"@types/glob": "^7.2.0",
"@types/mocha": "9.1.0",
"@types/node": "16.11.21",
"@types/react": "17.0.38",
"@types/react-dom": "17.0.11",
"babel-loader": "8.2.3",
"cpy-cli": "3.1.1",
"css-loader": "6.5.1",
"mini-css-extract-plugin": "2.5.3",
"mocha": "9.2.0",
"@types/node": "16.11.26",
"@types/react": "17.0.41",
"@types/react-dom": "17.0.14",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"babel-loader": "8.2.4",
"css-loader": "6.7.1",
"eslint": "^8.7.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"glob": "^7.2.0",
"mini-css-extract-plugin": "2.6.0",
"mocha": "9.2.2",
"prettier": "^2.5.1",
"puppeteer": "^13.1.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"sass": "1.49.0",
"sass-loader": "12.4.0",
"ts-loader": "9.2.6",
"ts-node": "10.4.0",
"typescript": "4.5.5",
"webpack": "5.67.0",
"sass": "1.49.9",
"sass-loader": "12.6.0",
"shx": "^0.3.4",
"source-map-support": "0.5.21",
"ts-loader": "9.2.8",
"ts-node": "10.7.0",
"typescript": "4.6.2",
"webpack": "5.70.0",
"webpack-cli": "4.9.2"

@@ -53,0 +72,0 @@ },

@@ -0,4 +1,4 @@

import * as messages from '@cucumber/messages'
import fs from 'fs'
import { Readable, Transform, TransformCallback } from 'stream'
import * as messages from '@cucumber/messages'

@@ -14,3 +14,6 @@ export default class CucumberHtmlStream extends Transform {

*/
constructor(private readonly cssPath: string, private readonly jsPath: string) {
constructor(
private readonly cssPath: string,
private readonly jsPath: string
) {
super({ objectMode: true })

@@ -83,3 +86,6 @@ }

if (err) return callback(err)
const beginIndex = begin == null ? 0 : template.indexOf(begin) + begin.length
if (!template)
return callback(new Error('template is required if error is missing'))
const beginIndex =
begin == null ? 0 : template.indexOf(begin) + begin.length
const endIndex = end == null ? template.length : template.indexOf(end)

@@ -91,11 +97,17 @@ this.push(template.substring(beginIndex, endIndex))

private readTemplate(callback: (error?: Error | null, data?: string) => void) {
private readTemplate(
callback: (error?: Error | null, data?: string) => void
) {
if (this.template !== null) {
return callback(null, this.template)
}
fs.readFile(__dirname + '/index.mustache.html', { encoding: 'utf-8' }, (err, template) => {
if (err) return callback(err)
this.template = template
return callback(null, template)
})
fs.readFile(
__dirname + '/index.mustache.html',
{ encoding: 'utf-8' },
(err, template) => {
if (err) return callback(err)
this.template = template
return callback(null, template)
}
)
}

@@ -102,0 +114,0 @@

import * as messages from '@cucumber/messages'
import CucumberHtmlStream from '../src/CucumberHtmlStream'
import assert from 'assert'
import { Writable } from 'stream'
import assert from 'assert'
async function renderAsHtml(...envelopes: messages.Envelope[]): Promise<string> {
import CucumberHtmlStream from '../src/CucumberHtmlStream'
async function renderAsHtml(
...envelopes: messages.Envelope[]
): Promise<string> {
return new Promise((resolve, reject) => {
let html = ''
const sink: Writable = new Writable({
write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void {
write(
chunk: string,
_: string,
callback: (error?: Error | null) => void
): void {
html += chunk

@@ -43,3 +50,5 @@ callback()

const html = await renderAsHtml(e1)
assert(html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)}]`) >= 0)
assert(
html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)}]`) >= 0
)
})

@@ -61,5 +70,9 @@

assert(
html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)},${JSON.stringify(e2)}]`) >= 0
html.indexOf(
`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)},${JSON.stringify(
e2
)}]`
) >= 0
)
})
})
{
"extends": "../../tsconfig.build.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "dist"
"outDir": "dist",
"composite": true,
"declarationMap": true,
"noEmit": false
},

@@ -10,5 +13,4 @@ "include": [

"test",
"features",
"package.json"
]
}
{
"extends": "../../tsconfig.json"
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"sourceMap": true,
"allowJs": false,
"resolveJsonModule": true,
"esModuleInterop": true,
"noImplicitAny": true,
"downlevelIteration": true,
"skipLibCheck": true,
"strictNullChecks": true,
"experimentalDecorators": true,
"module": "CommonJS",
"lib": [
"ES6",
"dom"
],
"target": "ES6",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"noEmit": true,
"jsx": "react"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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