1
1
import { describe , it } from 'mocha'
2
2
import { expect } from 'chai'
3
3
import { reindent } from 'reindent-template-literals'
4
- import * as messages from '@cucumber/messages'
4
+ import { GherkinDocument } from '@cucumber/messages'
5
5
import {
6
6
IParsedSourceWithEnvelopes ,
7
7
parse ,
@@ -13,8 +13,6 @@ import {
13
13
getGherkinStepMap ,
14
14
} from './gherkin_document_parser'
15
15
16
- import IGherkinDocument = messages . GherkinDocument
17
-
18
16
describe ( 'GherkinDocumentParser' , ( ) => {
19
17
describe ( 'getGherkinStepMap' , ( ) => {
20
18
it ( 'works for a Background and Scenario' , async ( ) => {
@@ -308,15 +306,15 @@ describe('GherkinDocumentParser', () => {
308
306
} )
309
307
} )
310
308
311
- async function parseGherkinDocument ( data : string ) : Promise < IGherkinDocument > {
309
+ async function parseGherkinDocument ( data : string ) : Promise < GherkinDocument > {
312
310
const parsed : IParsedSourceWithEnvelopes = await parse ( {
313
311
data,
314
312
uri : 'features/a.feature' ,
315
313
} )
316
314
return parsed . gherkinDocument
317
315
}
318
316
319
- async function withBackgroundAndScenario ( ) : Promise < IGherkinDocument > {
317
+ async function withBackgroundAndScenario ( ) : Promise < GherkinDocument > {
320
318
return await parseGherkinDocument (
321
319
reindent ( `
322
320
Feature: a feature
@@ -329,7 +327,7 @@ async function withBackgroundAndScenario(): Promise<IGherkinDocument> {
329
327
)
330
328
}
331
329
332
- async function withBackgroundAndScenarioOutline ( ) : Promise < IGherkinDocument > {
330
+ async function withBackgroundAndScenarioOutline ( ) : Promise < GherkinDocument > {
333
331
return await parseGherkinDocument (
334
332
reindent ( `
335
333
Feature: a feature
@@ -346,7 +344,7 @@ async function withBackgroundAndScenarioOutline(): Promise<IGherkinDocument> {
346
344
)
347
345
}
348
346
349
- async function withBackgroundAndRuleWithExamples ( ) : Promise < IGherkinDocument > {
347
+ async function withBackgroundAndRuleWithExamples ( ) : Promise < GherkinDocument > {
350
348
return await parseGherkinDocument (
351
349
reindent ( `
352
350
Feature: a feature
@@ -365,7 +363,7 @@ async function withBackgroundAndRuleWithExamples(): Promise<IGherkinDocument> {
365
363
)
366
364
}
367
365
368
- async function withBackgroundAndRuleWithBackgroundAndExamples ( ) : Promise < IGherkinDocument > {
366
+ async function withBackgroundAndRuleWithBackgroundAndExamples ( ) : Promise < GherkinDocument > {
369
367
return await parseGherkinDocument (
370
368
reindent ( `
371
369
Feature: a feature
0 commit comments