Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nuxt/test-utils
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.13.1
Choose a base ref
...
head repository: nuxt/test-utils
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.14.0
Choose a head ref

Commits on May 19, 2024

  1. fix: revert execa to v8 for now

    danielroe committed May 19, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fef8b06 View commit details
  2. chore: update type

    danielroe committed May 19, 2024
    Copy the full SHA
    052094b View commit details
  3. ci: run test suite on windows (#851)

    danielroe authored May 19, 2024
    Copy the full SHA
    dfababb View commit details
  4. chore(deps): update all non-major dependencies (#850)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
    Co-authored-by: Daniel Roe <daniel@roe.dev>
    3 people authored May 19, 2024
    Copy the full SHA
    9b028db View commit details
  5. fix(config): force buildId to test manually

    danielroe committed May 19, 2024
    Copy the full SHA
    25e081e View commit details

Commits on May 20, 2024

  1. fix(runtime-utils): use appId fallback after tryUseNuxtApp (#849)

    danielroe authored May 20, 2024
    Copy the full SHA
    81a9a72 View commit details
  2. chore(release): v3.13.1

    danielroe committed May 20, 2024
    Copy the full SHA
    fcc1060 View commit details
  3. feat(runtime-utils): expose setup result from renderSuspended (#852)

    joaovitoras authored May 20, 2024
    Copy the full SHA
    6ec39d4 View commit details

Commits on May 22, 2024

  1. chore(deps): update all non-major dependencies (#855)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored May 22, 2024
    Copy the full SHA
    bcaf650 View commit details
  2. chore(deps): update dependency fake-indexeddb to v6 (#856)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored May 22, 2024
    Copy the full SHA
    293cead View commit details
  3. fix(runtime-utils): ts-ignore #build/ import until nuxt v3.12 release

    danielroe committed May 22, 2024
    Copy the full SHA
    66b23ae View commit details

Commits on Jun 7, 2024

  1. chore: ignore ts-ignores for now

    danielroe committed Jun 7, 2024
    Copy the full SHA
    ac2d9fb View commit details

Commits on Jun 28, 2024

  1. chore: add @danielroe to code owners

    danielroe committed Jun 28, 2024
    Copy the full SHA
    76f65b3 View commit details

Commits on Jul 1, 2024

  1. fix(runtime-utils): allow setProps to replace an array (#877)

    tomoki1207 authored Jul 1, 2024
    Copy the full SHA
    a393b3e View commit details
  2. chore(deps): update autofix-ci/action digest to dd55f44 (#870)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 1, 2024
    Copy the full SHA
    2cd9603 View commit details
  3. chore(deps): update nuxt framework (#866)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 1, 2024
    Copy the full SHA
    16607c6 View commit details
  4. chore: remove ts-ignore now that we're upgraded

    danielroe committed Jul 1, 2024
    Copy the full SHA
    16827f7 View commit details
  5. test: bump timeout in windows browser spec

    danielroe committed Jul 1, 2024
    Copy the full SHA
    73e2c71 View commit details
  6. chore(deps): update all non-major dependencies (#859)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Daniel Roe <daniel@roe.dev>
    renovate[bot] and danielroe authored Jul 1, 2024
    Copy the full SHA
    58d7714 View commit details
  7. chore(deps): update autofix-ci/action digest to 2891949 (#878)

    renovate[bot] authored Jul 1, 2024
    Copy the full SHA
    0e9b430 View commit details

Commits on Jul 2, 2024

  1. chore(deps): update nuxt framework to ^3.12.3 (#879)

    renovate[bot] authored Jul 2, 2024
    Copy the full SHA
    70222c3 View commit details

Commits on Jul 11, 2024

  1. chore(deps): update all non-major dependencies (#880)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Daniel Roe <daniel@roe.dev>
    renovate[bot] and danielroe authored Jul 11, 2024
    Copy the full SHA
    2dd02d7 View commit details
  2. chore(deps): update vitest to v2 (major) (#886)

    renovate[bot] authored Jul 11, 2024
    Copy the full SHA
    ee83904 View commit details

Commits on Jul 15, 2024

  1. chore(deps): update devdependency eslint to v9.7.0 (#887)

    renovate[bot] authored Jul 15, 2024
    Copy the full SHA
    eee7abd View commit details

Commits on Jul 16, 2024

  1. chore(deps): update resolutions vite to v5.3.4 (#889)

    renovate[bot] authored Jul 16, 2024
    Copy the full SHA
    cd58fc5 View commit details

Commits on Jul 18, 2024

  1. chore(deps): update vitest to v2.0.3 (#888)

    renovate[bot] authored Jul 18, 2024
    Copy the full SHA
    f38939a View commit details
  2. chore(deps): update autofix-ci/action digest to ff86a55 (#894)

    renovate[bot] authored Jul 18, 2024
    Copy the full SHA
    6abe500 View commit details

Commits on Jul 19, 2024

  1. chore(deps): update nuxt framework to ^3.12.4 (#896)

    renovate[bot] authored Jul 19, 2024
    Copy the full SHA
    8a4f9b6 View commit details
  2. chore(deps): update all non-major dependencies (#890)

    renovate[bot] authored Jul 19, 2024
    Copy the full SHA
    2b4d1c3 View commit details
  3. chore(deps): update resolutions vue to ^3.4.33 (#898)

    renovate[bot] authored Jul 19, 2024
    Copy the full SHA
    043c768 View commit details

Commits on Jul 22, 2024

  1. chore(deps): update all non-major dependencies (#900)

    renovate[bot] authored Jul 22, 2024
    Copy the full SHA
    5f5a5be View commit details

Commits on Jul 26, 2024

  1. chore(deps): update vitest to v2.0.4 (#902)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 26, 2024
    Copy the full SHA
    fee8740 View commit details
  2. chore(deps): update all non-major dependencies (#901)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Daniel Roe <daniel@roe.dev>
    renovate[bot] and danielroe authored Jul 26, 2024
    Copy the full SHA
    9aa42c7 View commit details
  3. feat(e2e): allow overwriting env variables in setup (#903)

    markbrockhoff authored Jul 26, 2024
    Copy the full SHA
    f310a05 View commit details
  4. feat(e2e): allow running e2e tests against existing server (#803)

    tobiasdiez authored Jul 26, 2024
    Copy the full SHA
    c4df41d View commit details
  5. feat(e2e): allow updating env in context before setup runs (#812)

    linspw authored Jul 26, 2024
    Copy the full SHA
    0fe0e6b View commit details
  6. chore(release): v3.14.0

    danielroe committed Jul 26, 2024
    Copy the full SHA
    587a0b5 View commit details
Showing with 3,949 additions and 2,640 deletions.
  1. +3 −3 .github/workflows/autofix.yml
  2. +2 −2 .github/workflows/changelogensets.yml
  3. +8 −5 .github/workflows/ci.yml
  4. +2 −2 .github/workflows/release-nightly.yml
  5. +2 −2 .github/workflows/release.yml
  6. +1 −1 .github/workflows/reproduction.yml
  7. +57 −0 CHANGELOG.md
  8. +1 −0 CODEOWNERS
  9. +1 −1 examples/app-jest/test/browser.e2e.spec.ts
  10. +5 −1 examples/app-playwright/app.vue
  11. +5 −0 examples/app-playwright/nuxt.config.ts
  12. +14 −0 examples/app-playwright/tests/basic.test.ts
  13. +9 −0 examples/app-vitest-full/components/ExportDefaultComponent.vue
  14. +5 −0 examples/app-vitest-full/components/ExportDefaultReturnsRenderComponent.vue
  15. +5 −0 examples/app-vitest-full/components/ExportDefaultWithRenderComponent.vue
  16. +8 −0 examples/app-vitest-full/components/ExportDefineComponent.vue
  17. +15 −2 examples/app-vitest-full/tests/nuxt/mount-suspended.spec.ts
  18. +50 −8 examples/app-vitest-full/tests/nuxt/render-suspended.spec.ts
  19. +1 −1 examples/app-vitest/test/browser.e2e.spec.ts
  20. +44 −39 package.json
  21. +13 −0 patches/nuxt@3.11.2.patch
  22. +3,592 −2,532 pnpm-lock.yaml
  23. +1 −1 scripts/update-changelog.ts
  24. +2 −0 src/config.ts
  25. +8 −0 src/core/context.ts
  26. +15 −12 src/core/nuxt.ts
  27. +5 −3 src/core/server.ts
  28. +1 −1 src/core/setup/index.ts
  29. +2 −1 src/core/setup/vitest.ts
  30. +5 −2 src/core/types.ts
  31. +12 −4 src/runtime-utils/mount.ts
  32. +54 −16 src/runtime-utils/render.ts
  33. +1 −1 stubs/vitest-environment-nuxt/package.json
6 changes: 3 additions & 3 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: corepack enable
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
cache: "pnpm"
@@ -26,4 +26,4 @@ jobs:
- name: Lint (code)
run: pnpm lint:fix

- uses: autofix-ci/action@ea32e3a12414e6d3183163c3424a7d7a8631ad84
- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
4 changes: 2 additions & 2 deletions .github/workflows/changelogensets.yml
Original file line number Diff line number Diff line change
@@ -19,11 +19,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
cache: "pnpm"
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -30,9 +30,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: corepack enable
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
cache: "pnpm"
@@ -44,12 +44,15 @@ jobs:
run: pnpm lint

test:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: corepack enable
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
cache: "pnpm"
4 changes: 2 additions & 2 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- run: corepack enable
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
registry-url: "https://registry.npmjs.org/"
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
registry-url: "https://registry.npmjs.org/"
2 changes: 1 addition & 1 deletion .github/workflows/reproduction.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ jobs:
reproduire:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: Hebilicious/reproduire@4b686ae9cbb72dad60f001d278b6e3b2ce40a9ac # v0.0.9-mp
with:
label: needs reproduction
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,63 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## v3.14.0

[compare changes](https://github.com/nuxt/test-utils/compare/v3.13.1...v3.14.0)

### 🚀 Enhancements

- **runtime-utils:** Expose setup result from `renderSuspended` ([#852](https://github.com/nuxt/test-utils/pull/852))
- **e2e:** Allow overwriting env variables in `setup` ([#903](https://github.com/nuxt/test-utils/pull/903))
- **e2e:** Allow running e2e tests against existing server ([#803](https://github.com/nuxt/test-utils/pull/803))
- **e2e:** Allow updating env in context before `setup` runs ([#812](https://github.com/nuxt/test-utils/pull/812))

### 🩹 Fixes

- **runtime-utils:** Ts-ignore `#build/` import until nuxt v3.12 release ([66b23ae6](https://github.com/nuxt/test-utils/commit/66b23ae6))
- **runtime-utils:** Allow `setProps` to replace an array ([#877](https://github.com/nuxt/test-utils/pull/877))

### 🏡 Chore

- Ignore ts-ignores for now ([ac2d9fbb](https://github.com/nuxt/test-utils/commit/ac2d9fbb))
- Add @danielroe to code owners ([76f65b3b](https://github.com/nuxt/test-utils/commit/76f65b3b))
- Remove ts-ignore now that we're upgraded ([16827f7f](https://github.com/nuxt/test-utils/commit/16827f7f))

### ✅ Tests

- Bump timeout in windows browser spec ([73e2c716](https://github.com/nuxt/test-utils/commit/73e2c716))

### ❤️ Contributors

- Jessé Correia Lins ([@linspw](http://github.com/linspw))
- Tobias Diez <code@tobiasdiez.com>
- Mark Brockhoff ([@markbrockhoff](http://github.com/markbrockhoff))
- Daniel Roe ([@danielroe](http://github.com/danielroe))
- MaruyamaTomoki ([@tomoki1207](http://github.com/tomoki1207))
- Joao Vitor Alves <joaovitor_as08802@hotmail.com>

## v3.13.1

[compare changes](https://github.com/nuxt/test-utils/compare/v3.13.0...v3.13.1)

### 🩹 Fixes

- Revert `execa` to v8 for now ([fef8b062](https://github.com/nuxt/test-utils/commit/fef8b062))
- **config:** Force `buildId` to `test` manually ([25e081e4](https://github.com/nuxt/test-utils/commit/25e081e4))
- **runtime-utils:** Use `appId` fallback after `tryUseNuxtApp` ([#849](https://github.com/nuxt/test-utils/pull/849))

### 🏡 Chore

- Update type ([052094bc](https://github.com/nuxt/test-utils/commit/052094bc))

### 🤖 CI

- Run test suite on windows ([#851](https://github.com/nuxt/test-utils/pull/851))

### ❤️ Contributors

- Daniel Roe ([@danielroe](http://github.com/danielroe))

## v3.13.0

[compare changes](https://github.com/nuxt/test-utils/compare/v3.12.1...v3.13.0)
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @danielroe
2 changes: 1 addition & 1 deletion examples/app-jest/test/browser.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -12,5 +12,5 @@ describe('browser', () => {
const text = await page.getByRole('heading', { name: 'Welcome to Nuxt!' }).textContent()
expect(text).toContain('Welcome to Nuxt!')
await page.close()
})
}, 10000)
})
6 changes: 5 additions & 1 deletion examples/app-playwright/app.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<h1>
Welcome to Playwright!
{{ config.public.myValue }}
</h1>
</template>

<script setup>
const config = useRuntimeConfig()
</script>
5 changes: 5 additions & 0 deletions examples/app-playwright/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
runtimeConfig: {
public: {
myValue: 'Welcome to Playwright!',
},
},
})
14 changes: 14 additions & 0 deletions examples/app-playwright/tests/basic.test.ts
Original file line number Diff line number Diff line change
@@ -4,3 +4,17 @@ test('test', async ({ page, goto }) => {
await goto('/', { waitUntil: 'hydration' })
await expect(page.getByRole('heading')).toHaveText('Welcome to Playwright!')
})

const testHello = test.extend({
nuxt: async ({ nuxt }, use) => {
nuxt!.env = {
NUXT_PUBLIC_MY_VALUE: 'Hello World!',
}
await use(nuxt)
},
})

testHello('testing', async ({ page, goto }) => {
await goto('/', { waitUntil: 'hydration' })
await expect(page.getByRole('heading')).toHaveText('Hello World!')
})
Original file line number Diff line number Diff line change
@@ -3,6 +3,11 @@
<h1>ExportDefaultComponent</h1>
<pre>{{ myProp }}</pre>
<pre>{{ setupMyProp }}</pre>
<span
v-for="item in myArrayProp"
:key="item"
>{{ item }}
</span>
</div>
</template>

@@ -22,6 +27,10 @@ export default {
type: String,
required: true,
},
myArrayProp: {
type: Array as PropType<string[]>,
default: () => ([]),
},
},
setup(props) {
return {
Original file line number Diff line number Diff line change
@@ -5,13 +5,18 @@ export default {
type: String,
required: true,
},
myArrayProp: {
type: Array as PropType<string[]>,
default: () => ([]),
},
},
setup(props) {
const pre = 'X' + props.myProp
return () => h('div', [
h('h1', 'ExportDefaultReturnsRenderComponent'),
h('pre', props.myProp),
h('pre', pre),
props.myArrayProp.map(item => h('span', item)),
])
},
}
Original file line number Diff line number Diff line change
@@ -5,6 +5,10 @@ export default {
type: String,
required: true,
},
myArrayProp: {
type: Array as PropType<string[]>,
default: () => ([]),
},
},
setup(props) {
return {
@@ -16,6 +20,7 @@ export default {
h('h1', 'ExportDefaultWithRenderComponent'),
h('pre', this.myProp),
h('pre', this.setupMyProp),
this.myArrayProp.map(item => h('span', item)),
])
},
}
8 changes: 8 additions & 0 deletions examples/app-vitest-full/components/ExportDefineComponent.vue
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
<h1>ExportDefineComponent</h1>
<pre>{{ myProp }}</pre>
<pre>{{ setupMyProp }}</pre>
<span
v-for="item in myArrayProp"
:key="item"
>{{ item }}</span>
</div>
</template>

@@ -22,6 +26,10 @@ export default defineComponent({
type: String,
required: true,
},
myArrayProp: {
type: Array as PropType<string[]>,
default: () => ([]),
},
},
setup(props) {
return {
17 changes: 15 additions & 2 deletions examples/app-vitest-full/tests/nuxt/mount-suspended.spec.ts
Original file line number Diff line number Diff line change
@@ -126,14 +126,15 @@ describe.each(Object.entries(formats))(`%s`, (name, component) => {
wrapper = await mountSuspended(component, {
props: {
myProp: 'Hello nuxt-vitest',
myArrayProp: ['hello', 'nuxt', 'vitest'],
},
})
})

it('mounts with props', () => {
expect(wrapper.html()).toEqual(`
<div>
<h1>${name}</h1><pre>Hello nuxt-vitest</pre><pre>XHello nuxt-vitest</pre>
<h1>${name}</h1><pre>Hello nuxt-vitest</pre><pre>XHello nuxt-vitest</pre><span>hello</span><span>nuxt</span><span>vitest</span>
</div>
`.trim())
})
@@ -144,7 +145,19 @@ describe.each(Object.entries(formats))(`%s`, (name, component) => {
})
expect(wrapper.html()).toEqual(`
<div>
<h1>${name}</h1><pre>updated title</pre><pre>XHello nuxt-vitest</pre>
<h1>${name}</h1><pre>updated title</pre><pre>XHello nuxt-vitest</pre><span>hello</span><span>nuxt</span><span>vitest</span>
</div>
`.trim())
})

it('can be updated array with setProps', async () => {
await wrapper.setProps({
myProp: 'updated title',
myArrayProp: ['updated', 'prop'],
})
expect(wrapper.html()).toEqual(`
<div>
<h1>${name}</h1><pre>updated title</pre><pre>XHello nuxt-vitest</pre><span>updated</span><span>prop</span>
</div>
`.trim())
})
Loading