Skip to content

Commit

Permalink
build: prefer /e2e subpath export
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 9, 2023
1 parent de9a2a8 commit 88952fb
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const isStub = process.argv.includes('--stub')
export default defineBuildConfig({
declaration: true,
entries: [
'src/index',
'src/e2e',
'src/experimental',
'src/config',
'src/module.ts',
Expand Down
1 change: 1 addition & 0 deletions e2e.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dist/index'
2 changes: 1 addition & 1 deletion examples/app-jest/test/browser.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from 'node:url'
import { createPage, setup } from '@nuxt/test-utils'
import { createPage, setup } from '@nuxt/test-utils/e2e'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
Expand Down
2 changes: 1 addition & 1 deletion examples/app-jest/test/dev.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from 'node:url'
import { $fetch, setup } from '@nuxt/test-utils'
import { $fetch, setup } from '@nuxt/test-utils/e2e'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
Expand Down
4 changes: 2 additions & 2 deletions examples/app-jest/test/server.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from 'node:url'
import { $fetch, setup } from '@nuxt/test-utils'
import { $fetch, setup } from '@nuxt/test-utils/e2e'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
Expand All @@ -11,4 +11,4 @@ describe("app",()=>{
const html = await $fetch('/')
expect(html.slice(0, 15)).toMatchInlineSnapshot(`"<!DOCTYPE html>"`)
})
})
})
2 changes: 1 addition & 1 deletion examples/app-vitest/test/browser.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from 'node:url'
import { createPage, setup } from '@nuxt/test-utils'
import { createPage, setup } from '@nuxt/test-utils/e2e'
import { describe, expect, it } from 'vitest'

await setup({
Expand Down
2 changes: 1 addition & 1 deletion examples/app-vitest/test/dev.e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from 'node:url'
import { $fetch, setup } from '@nuxt/test-utils'
import { $fetch, setup } from '@nuxt/test-utils/e2e'
import { describe, expect, it } from 'vitest'

await setup({
Expand Down
2 changes: 1 addition & 1 deletion examples/app-vitest/test/server.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from 'node:url'
import { $fetch, setup } from '@nuxt/test-utils'
import { $fetch, setup } from '@nuxt/test-utils/e2e'
import { describe, expect, it } from 'vitest'

await setup({
Expand Down
2 changes: 1 addition & 1 deletion examples/module/test/basic.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fileURLToPath } from 'node:url'
import { describe, expect, it } from 'vitest'
import { $fetch, setup } from '@nuxt/test-utils'
import { $fetch, setup } from '@nuxt/test-utils/e2e'

describe('ssr', async () => {
await setup({
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
"description": "Test utilities for Nuxt",
"license": "MIT",
"type": "module",
"types": "./dist/index.d.ts",
"types": "./dist/e2e.d.ts",
"exports": {
".": "./dist/index.mjs",
".": "./dist/e2e.mjs",
"./config": "./dist/config.mjs",
"./e2e": "./dist/e2e.mjs",
"./experimental": "./dist/experimental.mjs",
"./module": "./dist/module.mjs",
"./runtime": "./dist/runtime-utils/index.mjs",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/runtime/global-setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as _kit from '@nuxt/kit'
import { createTest, exposeContextToEnv } from '@nuxt/test-utils'
import { createTest, exposeContextToEnv } from '@nuxt/test-utils/e2e'

// @ts-expect-error type cast
// eslint-disable-next-line
Expand Down

0 comments on commit 88952fb

Please sign in to comment.