nuxt-spec 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,7 +15,7 @@ Aside from being "forked" and used as you seem fit, `nuxt-spec` is also availabl
15
15
 
16
16
  1) Add following dependency into your `package.json`:
17
17
  ```
18
- "nuxt-spec": "0.0.2"
18
+ "nuxt-spec": "0.0.4"
19
19
  ```
20
20
 
21
21
  2) Add following section into your `nuxt.config.ts`:
@@ -46,6 +46,10 @@ strict-peer-dependencies=false
46
46
  - [@vue/test-utils](https://www.npmjs.com/package/@vue/test-utils) for testing Vue stuff
47
47
  - [@nuxt/test-utils](https://www.npmjs.com/package/@nuxt/test-utils) for testing Nuxt stuff
48
48
 
49
+ The suite provides two (p)npm commands, that can be run out-of-the-box in extending Nuxt projects:
50
+ - `test` - equal to `vitest run` (runs once and ends)
51
+ - `test-i` - equal to `vitest` (runs and waits in HMR for test changes)
52
+
49
53
  Planned future content:
50
54
  - [backstopjs](https://www.npmjs.com/package/backstopjs) as the solution for visual testing
51
55
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-spec",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Test-pack layer for Nuxt Applications",
5
5
  "repository": "github:AloisSeckar/nuxt-spec",
6
6
  "license": "MIT",
@@ -14,19 +14,20 @@
14
14
  "generate": "nuxt generate",
15
15
  "preview": "nuxt preview",
16
16
  "start": "nuxt start",
17
- "test": "vitest run"
17
+ "test": "vitest run",
18
+ "test-i": "vitest"
18
19
  },
19
20
  "dependencies": {
20
21
  "@nuxt/test-utils": "3.15.4",
21
22
  "@vue/test-utils": "2.4.6",
22
- "happy-dom": "16.7.3",
23
- "playwright-core": "1.50.0",
24
- "vitest": "3.0.4"
23
+ "happy-dom": "16.8.1",
24
+ "playwright-core": "1.50.1",
25
+ "vitest": "3.0.5"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@nuxt/eslint": "0.7.6",
28
29
  "nuxt": "3.15.4",
29
30
  "typescript": "latest"
30
31
  },
31
- "packageManager": "pnpm@9.15.4"
32
+ "packageManager": "pnpm@9.15.5"
32
33
  }
@@ -4,11 +4,7 @@ import { describe, expect, test } from 'vitest'
4
4
  describe('NuxtTestComponent E2E test', async () => {
5
5
  // setup app.vue in headless browser
6
6
  await setup()
7
-
8
- // TODO tests broken
9
- // Cannot find module '<local_path>\.nuxt\test\83opp2\output\server\node_modules\vue\server-renderer\index.mjs'
10
- // imported from <local_path>\.nuxt\test\83opp2\output\server\chunks\routes\renderer.mjs
11
-
7
+
12
8
  test('component renders in browser', async () => {
13
9
  // fetch for the rendered value
14
10
  const html = await $fetch('/')
@@ -16,9 +12,10 @@ describe('NuxtTestComponent E2E test', async () => {
16
12
  })
17
13
 
18
14
  test('with playwright', async () => {
15
+ // render page in headless browser
19
16
  const page = await createPage()
20
17
  await page.goto(url('/'), { waitUntil: 'hydration' })
21
- const text = page.textContent('div')
22
- console.log(text)
18
+ const hasText = await page.getByText('nuxt-spec').isVisible()
19
+ expect(hasText).toBeTruthy()
23
20
  })
24
21
  })