@@ -9,6 +9,7 @@ export * from "./utils";
99
1010export type VitestBddOptions = {
1111 debug ?: boolean ;
12+ concurrent ?: boolean ;
1213 markdownExtensions ?: string [ ] ;
1314 gherkinExtensions ?: string [ ] ;
1415 rescriptExtensions ?: string [ ] ;
@@ -18,6 +19,7 @@ export type VitestBddOptions = {
1819
1920const defaultOptions : Required < VitestBddOptions > = {
2021 debug : false ,
22+ concurrent : true ,
2123 markdownExtensions : [ ".md" , ".mdx" , ".markdown" ] ,
2224 gherkinExtensions : [ ".feature" ] ,
2325 rescriptExtensions : [ ".res" ] ,
@@ -47,6 +49,7 @@ export function vitestBdd(opts: VitestBddOptions = {}): Plugin {
4749function compile ( path : string , opts : Required < VitestBddOptions > ) {
4850 const { debug, rescriptExtensions, markdownExtensions, gherkinExtensions } =
4951 opts ;
52+ const concurrent = opts . concurrent ? ".concurrent" : "" ;
5053 const ext = extname ( path ) ;
5154 if ( rescriptExtensions . includes ( ext ) ) {
5255 return resCompile ( path , opts ) ;
@@ -81,11 +84,10 @@ function compile(path: string, opts: Required<VitestBddOptions>) {
8184 const base = { line : 1 , column : 0 } ;
8285 const stepsPath = opts . stepsResolver ( path ) ;
8386 if ( ! stepsPath ) {
84- const shortpath =
85- path . split ( "/" ) . slice ( - 4 ) . join ( "/" ) ;
87+ const shortpath = path . split ( "/" ) . slice ( - 4 ) . join ( "/" ) ;
8688 push ( `import { describe, it, assert } from "vitest";` , base ) ;
8789 push (
88- `describe. concurrent(${ JSON . stringify ( feature . title ) } , () => {` ,
90+ `describe${ concurrent } (${ JSON . stringify ( feature . title ) } , () => {` ,
8991 feature . location
9092 ) ;
9193 push (
@@ -105,7 +107,7 @@ function compile(path: string, opts: Required<VitestBddOptions>) {
105107 push ( `import { load } from "vitest-bdd";` , base ) ;
106108 push ( `import ${ JSON . stringify ( stepsPath ) } ;` , base ) ;
107109 push (
108- `describe. concurrent(${ JSON . stringify ( feature . title ) } , () => {` ,
110+ `describe${ concurrent } (${ JSON . stringify ( feature . title ) } , () => {` ,
109111 feature . location
110112 ) ;
111113 for ( const scenario of feature . scenarios ) {
0 commit comments