Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
declare global {
interface Window {
CUCUMBER_MESSAGES: any[]
}
}
const envelopes = window.CUCUMBER_MESSAGES.map((message: any) =>
messages.Envelope.fromObject(message)
)
const gherkinDocuments = envelopes
.filter(e => e.gherkinDocument)
.map(e => e.gherkinDocument)
const cucumberQuery = envelopes.reduce(
(q, e) => q.update(e),
new CucumberQuery()
)
const app = (
)
ReactDOM.render(app, document.getElementById('content'))
readFile(__dirname + '/../main.js', (err: Error, js: Buffer) => {
if (err) {
return callback(err)
}
const gherkinDocuments = this.envelopes
.filter(e => e.gherkinDocument)
.map(e => e.gherkinDocument)
const cucumberQuery = this.envelopes.reduce(
(q, e) => q.update(e),
new CucumberQuery()
)
this.push(`
<title>Cucumber</title>
<div id="content">
`)
this.push(
renderToString(
</div>
.add('Document list', () => {
const gherkinDocuments = envelopes.filter(e => e.gherkinDocument).map(e => e.gherkinDocument)
const gherkinQuery = new GherkinQuery()
const cucumberQuery = new CucumberQuery(gherkinQuery)
for (const envelope of envelopes) {
gherkinQuery.update(envelope)
cucumberQuery.update(envelope)
}
return
})
.add('Steps', () => {
import React from 'react'
import CucumberQuery from 'cucumber-query'
import { GherkinQuery } from 'gherkin'
export default React.createContext(new CucumberQuery(new GherkinQuery()))