Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add named export for CucumberHtmlStream #320

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- Add named export for `CucumberHtmlStream` ([#320](https://github.com/cucumber/html-formatter/pull/320))

## [21.5.0] - 2024-08-02
### Changed
Expand Down
4 changes: 2 additions & 2 deletions javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@cucumber/html-formatter",
"version": "21.5.0",
"description": "HTML formatter for Cucumber",
"main": "dist/src/CucumberHtmlStream.js",
"types": "dist/src/CucumberHtmlStream.d.ts",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/cucumber/html-formatter.git"
Expand Down
2 changes: 1 addition & 1 deletion javascript/src/CucumberHtmlStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as messages from '@cucumber/messages'
import fs from 'fs'
import { Readable, Transform, TransformCallback } from 'stream'

export default class CucumberHtmlStream extends Transform {
export class CucumberHtmlStream extends Transform {
private template: string | null = null
private preMessageWritten = false
private postMessageWritten = false
Expand Down
8 changes: 8 additions & 0 deletions javascript/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { CucumberHtmlStream } from './CucumberHtmlStream'

export * from './CucumberHtmlStream'

/**
* @deprecated use the named export `CucumberHtmlStream` instead
*/
export default CucumberHtmlStream
2 changes: 1 addition & 1 deletion javascript/test/CucumberHtmlStreamTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as messages from '@cucumber/messages'
import assert from 'assert'
import { Writable } from 'stream'

import CucumberHtmlStream from '../src/CucumberHtmlStream'
import { CucumberHtmlStream } from '../src'

async function renderAsHtml(
...envelopes: messages.Envelope[]
Expand Down
2 changes: 1 addition & 1 deletion javascript/test/acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import path from 'path'
import puppeteer from 'puppeteer'
import { PassThrough, pipeline } from 'stream'

import CucumberHtmlStream from '../src/CucumberHtmlStream'
import { CucumberHtmlStream } from '../src'

async function canRenderHtml(html: string): Promise<boolean> {
const browser = await puppeteer.launch({
Expand Down