Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions for 'out-of-the-box' TypeScript support #412

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Expand Up @@ -423,6 +423,27 @@ Install the plug-in type definitions:
npm install --save-dev @types/cypress-cucumber-preprocessor
```

### With out-of-the-box support

As of [Cypress
v4.4.0](https://github.com/cypress-io/cypress/releases/tag/v4.4.0), TypeScript
is supported out-of-the-box. To use it, add this to your `plugins/index.js`:

```javascript
const browserify = require('@cypress/browserify-preprocessor');
const cucumber = require('cypress-cucumber-preprocessor').default;
const resolve = require('resolve');

module.exports = (on, config) => {
const options = {
...browserify.defaultOptions,
typescript: resolve.sync('typescript', { baseDir: config.projectRoot }),
};

on('file:preprocessor', cucumber(options));
};
```

### With Webpack
You can also use a Webpack loader to process feature files (TypeScript supported). To see how it is done please take
a look here: [cypress-cucumber-webpack-typescript-example](https://github.com/TheBrainFamily/cypress-cucumber-webpack-typescript-example)
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: cypress/base:8
- image: cypress/base:12
working_directory: ~/cypress-cucumber-preprocessor
steps:
- checkout
Expand Down