Skip to main content

Comparison with Cucumber

Leftest can be thought of as a lightweight TypeScript interpretation of Gherkin syntax and Cucumber. Instead of IDE plugins it relies on type checking to get a reasonable DX with autocompletion and type checking of parameterised steps.

Gherkin feature files can be translated directly to Leftest syntax.

Feature: Guess the word
Scenario: Maker starts a game
When the Maker starts a game
Then the Maker waits for a Breaker to join

Here's another example using scenario outline

Scenario Outline: eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers

Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |

IntelliJ IDEA

For the best experience with IntelliJ IDEA:

Open settings Editor > Language Injections

Disable HTML in JS Strings

If you have it installed, also disable the Cucumber.js plugin. This plugin interferes with go-to definition for steps.