From 066c789ba74d8973a85cab7e0ea37fdbc62ff724 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Sat, 10 Aug 2019 22:08:10 +0100 Subject: [PATCH] Enable use of async/await in tests 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 --- .babelrc | 3 ++- package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.babelrc b/.babelrc index 1fb20f9b5c..f905c25de6 100644 --- a/.babelrc +++ b/.babelrc @@ -18,6 +18,7 @@ ], "plugins": [ "transform-object-rest-spread", - "transform-react-jsx" + "transform-react-jsx", + "transform-async-to-promises" ] } diff --git a/package.json b/package.json index 7e20b1877f..1bc7a106b0 100644 --- a/package.json +++ b/package.json @@ -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",