How to use the gherkin.fromSources function in gherkin

To help you get started, we’ve selected a few gherkin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cucumber / cucumber-js / test / gherkin_helpers.js View on Github external
return new Promise((resolve, reject) => {
    let source
    let gherkinDocument
    const pickles = []
    const envelopes = []
    const messageStream = Gherkin.fromSources(sources)
    messageStream.on('data', envelope => {
      envelopes.push(envelope)
      if (envelope.source) {
        source = envelope.source
      }
      if (envelope.gherkinDocument) {
        gherkinDocument = envelope.gherkinDocument
      }
      if (envelope.pickle) {
        pickles.push(envelope.pickle)
        envelopes.push(
          messages.Envelope.fromObject({
            pickleAccepted: { pickleId: envelope.pickle.id },
          })
        )
      }