Skip to content

Commit

Permalink
Enable use of async/await in tests
Browse files Browse the repository at this point in the history
Add a transform to convert async/await to Promises for use in tests.
This is the same low-footprint transform used by microbundle.

Slack discussion: https://preact.slack.com/archives/G9T60GUQ0/p1565514000140700
  • Loading branch information
robertknight committed Aug 11, 2019
1 parent 42aff16 commit 066c789
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
],
"plugins": [
"transform-object-rest-spread",
"transform-react-jsx"
"transform-react-jsx",
"transform-async-to-promises"
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"babel-core": "6.26.3",
"babel-loader": "7.1.5",
"babel-plugin-istanbul": "5.0.1",
"babel-plugin-transform-async-to-promises": "^0.8.14",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.6.1",
Expand Down

0 comments on commit 066c789

Please sign in to comment.