https://github.com/ideadapt/babel-plugin-transform-controlflow-asyncawait
Transform Control Flow based Selenium tests to async await syntax using a babel plugin.
https://github.com/ideadapt/babel-plugin-transform-controlflow-asyncawait
Last synced: 19 days ago
JSON representation
Transform Control Flow based Selenium tests to async await syntax using a babel plugin.
- Host: GitHub
- URL: https://github.com/ideadapt/babel-plugin-transform-controlflow-asyncawait
- Owner: ideadapt
- License: apache-2.0
- Created: 2018-08-13T19:29:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T15:41:00.000Z (about 7 years ago)
- Last Synced: 2026-02-07T00:51:39.420Z (5 months ago)
- Language: JavaScript
- Size: 501 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.com/ideadapt/babel-plugin-transform-controlflow-asyncawait)
## Usage:
To migrate code.js in place: \
`npx codemod --plugin build/src/main.js __fixtures__/jasmine/code.js`
To read code.js and write migrated output to migrated.js \
`cat __fixtures__/jasmine/code.js | npx codemod --plugin build/src/main.js --stdio --plugin-options transformAsyncAwait='{"customCalls": "get|open|enter|confirm|clear"}' > migrated.js`
### Plugin Options
#### customCalls
Provide substrings of function names that return most probably a promise. \
For example you might have a convention, that your page objects have getter methods that are to be prefixed with "get". \
For instance `new HeaderPO().getMenu();`. If you provide "get" as option value, this would be transformed to `await new HeaderPO().getMenu();`.
To provide multiple prefixes, concatenate them via pipe | (see example in usage chapter). \
\
Default: 'get|open|enter|clear'
## Development:
`npm run test:watch` \
`npm run build`