UNPKG

@serenity-js/cucumber

Version:

Serenity/JS test runner adapter for seamless integration with any version of Cucumber.js, facilitating BDD-style test automation and leveraging Serenity/JS reporting capabilities

26 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TempFileOutputDescriptor = void 0; /** * Cucumber.js allows [max 1 formatter per output](https://github.com/cucumber/cucumber-js/blob/625fab034eea768bf74f7a46993a57182204ddf6/src/cli/index.ts#L83-L140) * and doesn't allow writing to \\.\NUL on Windows (equivalent of *nix /dev/null) because of the [check in OptionSplitter](https://github.com/cucumber/cucumber-js/blob/625fab034eea768bf74f7a46993a57182204ddf6/src/cli/option_splitter.ts#L3) * so instead I create a dummy temp file, which is deleted when the test run is finished. * * @group Integration */ class TempFileOutputDescriptor { fileSystem; path; constructor(fileSystem) { this.fileSystem = fileSystem; this.path = this.fileSystem.tempFilePath('serenity-'); } value() { return this.path.value; } cleanUp() { return this.fileSystem.remove(this.path); } } exports.TempFileOutputDescriptor = TempFileOutputDescriptor; //# sourceMappingURL=TempFileOutputDescriptor.js.map