Skip to content

Commit

Permalink
Tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
badeball committed Jun 12, 2023
1 parent 38e4d2c commit 22f1a60
Show file tree
Hide file tree
Showing 26 changed files with 136 additions and 68 deletions.
File renamed without changes.
118 changes: 93 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"Julien Biezemans <jb@jbpros.com>"
],
"license": "MIT",
"type": "module",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"files": [
Expand All @@ -35,9 +36,9 @@
"update-dependencies": "npx npm-check-updates --upgrade --dep prod,dev,optional,bundle"
},
"dependencies": {
"ansi-styles": "^5.0.0",
"ansi-styles": "^6.2.1",
"cli-table3": "^0.6.0",
"figures": "^3.2.0",
"figures": "^5.0.0",
"ts-dedent": "^2.0.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/indentStyleText.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'should'

import { indentStyleText } from './indentStyleText'
import { styleText } from './styleText'
import { indentStyleText } from './indentStyleText.js'
import { styleText } from './styleText.js'

describe('indentStyleText', () => {
it('leaves text unstyled', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/indentStyleText.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styleText, TextStyle } from './styleText'
import { styleText, TextStyle } from './styleText.js'

export const indentStyleText = (
indent: number,
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import {
} from '@cucumber/cucumber'
import * as messages from '@cucumber/messages'
import * as CliTable3 from 'cli-table3'
import { cross, tick } from 'figures'
import figures from 'figures'
import { EOL as n } from 'os'
import dedent from 'ts-dedent'

import { makeTheme, ThemeItem, ThemeStyles } from './theme'
import { makeTheme, ThemeItem, ThemeStyles } from './theme.js'

const { formatLocation, GherkinDocumentParser, PickleParser } = formatterHelpers
const {
Expand All @@ -21,9 +21,9 @@ const {
const { getPickleStepMap } = PickleParser

const marks = {
[Status.AMBIGUOUS]: cross,
[Status.FAILED]: cross,
[Status.PASSED]: tick,
[Status.AMBIGUOUS]: figures.cross,
[Status.FAILED]: figures.cross,
[Status.PASSED]: figures.tick,
[Status.PENDING]: '?',
[Status.SKIPPED]: '-',
[Status.UNDEFINED]: '?',
Expand Down
2 changes: 1 addition & 1 deletion src/styleText.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'should'

import { styleText } from './styleText'
import { styleText } from './styleText.js'

describe('styleText()', () => {
it('applies modifiers', () => {
Expand Down
7 changes: 3 additions & 4 deletions src/styleText.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import {
import ansi, {
BackgroundColor,
bgColor,
color,
CSPair,
ForegroundColor,
modifier,
Modifier,
} from 'ansi-styles'

const { bgColor, color, modifier } = ansi

export type TextStyle =
| keyof BackgroundColor
| keyof ForegroundColor
Expand Down
4 changes: 2 additions & 2 deletions src/theme.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'should'
import { styleText } from './styleText'
import { styleText } from './styleText.js'

import {
IndentStyleThemeItem,
makeTheme,
ThemeItem,
ThemeStyles,
} from './theme'
} from './theme.js'

describe('Theme', () => {
let styleThemeItem: IndentStyleThemeItem
Expand Down
4 changes: 2 additions & 2 deletions src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { indentStyleText } from './indentStyleText'
import { TextStyle } from './styleText'
import { indentStyleText } from './indentStyleText.js'
import { TextStyle } from './styleText.js'

export enum ThemeItem {
DataTable = 'datatable',
Expand Down
4 changes: 2 additions & 2 deletions test/background.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'should'

import { run } from './exec'
import { run } from './exec.js'

describe('Background', () => {
describe.only('Background', () => {
it('does not log backgrounds', async () => {
const result = await run('background.feature')
result.should.startWith(
Expand Down
2 changes: 1 addition & 1 deletion test/data-table.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'should'

import { run } from './exec'
import { run } from './exec.js'

describe('Data Table', () => {
it('logs data tables', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/description.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'should'

import { run } from './exec'
import { run } from './exec.js'

describe('Description', () => {
it('logs feature descriptions', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/doc-string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'should'

import { run } from './exec'
import { run } from './exec.js'

describe('Doc String', () => {
it('logs doc strings', async () => {
Expand Down
9 changes: 4 additions & 5 deletions test/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
loadConfiguration,
runCucumber,
} from '@cucumber/cucumber/api'
import * as glob from 'glob'
import glob from 'glob'
import { join } from 'path'
import { PassThrough } from 'stream'
import * as streamToString from 'stream-to-string'
Expand Down Expand Up @@ -50,15 +50,14 @@ export const run = async (
await runCucumber(runConfiguration, {
cwd: join(__dirname, '..', '..'),
stdout,
stderr,
stderr: process.stderr,
})
} catch (ex) {
if (throws) {
throw ex
}
throw ex
}
stdout.end()
stderr.end()
const result = await streamToString(stdout)
console.log({result})
return result.replace(/\d+m\d+\.\d+s/g, '0m00.000s')
}
2 changes: 1 addition & 1 deletion test/feature.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'should'

import { run } from './exec'
import { run } from './exec.js'

describe('Feature', () => {
it('logs feature names and inserts new lines between scenarios and features', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/hook.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'should'

import { run } from './exec'
import { run } from './exec.js'

describe('Hook', () => {
it('does not log hooks', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/i18n.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'should'

import { run } from './exec'
import { run } from './exec.js'

describe('Internationalization', () => {
it('logs French', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/rule.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'should'

import { run } from './exec'
import { run } from './exec.js'

describe('Rule', () => {
it('logs rules', async () => {
Expand Down
Loading

0 comments on commit 22f1a60

Please sign in to comment.