Is it possible to run Cucumber.js programmatically?

Viewed 490

I'm constructing a e2e-testing framework which utilizes cucumber. The framework is meant to be used by our customers who build web-applications with our tooling.

I'd like to ensure that the framework is functioning correctly by testing it. Unfortunately it seems that the Cucumber.js API has no means to run the program without using a CLI. I'd much prefer to avoid running tests based on the outcome of a CLI.

So, my question, is it possible to run cucumber.js programmatically?

I can't find any documentation on this. Thanks in advance for any answers.

2 Answers

There seems to be some functionality to do this. It's undocumented however. There is an issue [ https://github.com/cucumber/cucumber-js/issues/1004 ] with a request to update the API Usage documentation. However, the issue dates back to 2018 and hasn't received a whole lot of attention since.

use the child_process module to spawn cucumber.

Related