Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

How to write Gherkin steps with ReScript ? ideas needed (vitest-bdd)

$
0
0

hey, I’m not sure what’s your issue here, you could use @as and externals to bind to functions with starting with an uppercase and bind to multiple languages at the same time:

type givenUtils = {
  @as("When") when_: 'a. (string, 'a) => unit,
  @as("Then") then: 'a. (string, 'a) => unit,
  @as("And") and_: 'a. (string, 'a) => unit,
  @as("Quand") quand: 'a. (string, 'a) => unit,
}
@module("vitest-bdd")
external given: (string, (givenUtils, 'args) => unit) => unit = "Given"

If it compiles to correct js files, I guess you could parse the generated js files, couldn’t you?


Viewing all articles
Browse latest Browse all 2592

Trending Articles