From 1fb9ba66532e53d25cbff6fbd04b64eb22833c71 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Fri, 22 Jul 2022 18:01:42 -0500 Subject: [PATCH] Add tests that will fail with ECMA 6 parsing --- src/fixtures/nuxt/async.expected.js | 18 ++++++++++++++++++ src/fixtures/nuxt/async.js | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/fixtures/nuxt/async.expected.js create mode 100644 src/fixtures/nuxt/async.js diff --git a/src/fixtures/nuxt/async.expected.js b/src/fixtures/nuxt/async.expected.js new file mode 100644 index 0000000..c7e9ce8 --- /dev/null +++ b/src/fixtures/nuxt/async.expected.js @@ -0,0 +1,18 @@ +const getAllDynamicRoute = async function() { + const routes = await (async () => { + return ['/posts/hello-world', '/posts/hello-again']; + })(); + return routes; + }; + + export default { + target: 'static', + router: {base: '/docs/'}, + mode: 'universal', + generate: { + async routes () { + return getAllDynamicRoute(); + } + } + }; + \ No newline at end of file diff --git a/src/fixtures/nuxt/async.js b/src/fixtures/nuxt/async.js new file mode 100644 index 0000000..00b6057 --- /dev/null +++ b/src/fixtures/nuxt/async.js @@ -0,0 +1,15 @@ +const getAllDynamicRoute = async function() { + const routes = await (async () => { + return ['/posts/hello-world', '/posts/hello-again']; + })(); + return routes; +}; + +export default { + mode: 'universal', + generate: { + async routes () { + return getAllDynamicRoute(); + } + } +};