From 45f22a418a56f8a306d714d3a1d2134dbd400cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Tue, 27 Dec 2016 16:31:25 +0100 Subject: [PATCH] Add tests for async/await --- test/basic.test.js | 10 ++++++++++ test/fixtures/basic/pages/await-async-data.vue | 17 +++++++++++++++++ .../basic/pages/callback-async-data.vue | 13 +++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 test/fixtures/basic/pages/await-async-data.vue create mode 100644 test/fixtures/basic/pages/callback-async-data.vue diff --git a/test/basic.test.js b/test/basic.test.js index b720fd3b82..103423f686 100755 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -56,6 +56,16 @@ test('/async-data', async t => { t.true(html.includes('

Nuxt.js

')) }) +test('/await-async-data', async t => { + const { html } = await nuxt.renderRoute('/await-async-data') + t.true(html.includes('

Await Nuxt.js

')) +}) + +test('/callback-async-data', async t => { + const { html } = await nuxt.renderRoute('/callback-async-data') + t.true(html.includes('

Callback Nuxt.js

')) +}) + test('/users/1', async t => { const { html } = await nuxt.renderRoute('/users/1') t.true(html.includes('

User: 1

')) diff --git a/test/fixtures/basic/pages/await-async-data.vue b/test/fixtures/basic/pages/await-async-data.vue new file mode 100644 index 0000000000..dbe80fac14 --- /dev/null +++ b/test/fixtures/basic/pages/await-async-data.vue @@ -0,0 +1,17 @@ + + + diff --git a/test/fixtures/basic/pages/callback-async-data.vue b/test/fixtures/basic/pages/callback-async-data.vue new file mode 100644 index 0000000000..03194c28fd --- /dev/null +++ b/test/fixtures/basic/pages/callback-async-data.vue @@ -0,0 +1,13 @@ + + +