cucumber-to-junit
Version:
Converts [Cucumber.js](https://github.com/cucumber/cucumber-js) json results files to JUnit XML.
72 lines (42 loc) • 1.33 kB
Markdown
Converts [Cucumber.js](https://github.com/cucumber/cucumber-js) json results files to JUnit XML.
Useful for reporting tests in Azure DevOps or Jenkins etc.
To install the latest version, run:
npm i cucumber-to-junit --save
```typescript
import { CucumberConverter } from 'cucumber-to-junit';
const converter = new CucumberConverter({
markUndefinedAsFailed: true // undefined scenario steps will fail the test case
});
converter.convertToJunit('path/to/cucumber.json', 'path/to/output.xml');
```
```javascript
const { CucumberConverter } = require('cucumber-to-junit');
const converter = new CucumberConverter({
markUndefinedAsFailed: true // undefined scenario steps will fail the test case
});
converter.convertToJunit('path/to/cucumber.json', 'path/to/output.xml');
```
To run the project:
```bash
npm start
```
This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
To do a one-off build, use `npm run build` or `yarn build`.
To run tests, use `npm test` or `yarn test`.
[](LICENSE)
- Update documentation
- Bug fixes
- Bug fixes
- Initial release