diff --git a/packages/playground/json/__tests__/json.spec.ts b/packages/playground/json/__tests__/json.spec.ts index cd15c1d50dc4de..2a9451d1c41ca7 100644 --- a/packages/playground/json/__tests__/json.spec.ts +++ b/packages/playground/json/__tests__/json.spec.ts @@ -1,5 +1,7 @@ const json = require('../test.json') +const deepJson = require('@vue/runtime-core/package.json') const stringified = JSON.stringify(json) +const deepStringified = JSON.stringify(deepJson) test('default import', async () => { expect(await page.textContent('.full')).toBe(stringified) @@ -9,6 +11,14 @@ test('named import', async () => { expect(await page.textContent('.named')).toBe(json.hello) }) +test('deep import', async () => { + expect(await page.textContent('.deep-full')).toBe(deepStringified) +}) + +test('named deep import', async () => { + expect(await page.textContent('.deep-named')).toBe(deepJson.name) +}) + test('dynamic import', async () => { expect(await page.textContent('.dynamic')).toBe(stringified) }) diff --git a/packages/playground/json/index.html b/packages/playground/json/index.html index 3c5eaca233d268..0efaea3147a164 100644 --- a/packages/playground/json/index.html +++ b/packages/playground/json/index.html @@ -2,6 +2,10 @@