sveltejs / kit

web development, streamlined
https://kit.svelte.dev
MIT License
18.44k stars 1.89k forks source link

Playwright reports Error: No tests found after fresh install #9793

Closed jakerr closed 1 year ago

jakerr commented 1 year ago

Describe the bug

Running the npm create svelte@latest script and then attempting to run the playwright tests gives an error.

$ playwright test
[WebServer] 
[WebServer] 
[WebServer] 
Error: No tests found

I tried with various combinations such as the "App" template and the "Library" template, as well as Typescript v.s. Javascript. And they all show that same error even though there appears to be a default test at:

tests/test.ts or tests/test.js

Reproduction

Run the following:

npm create svelte@latest my-app
cd my-app
npm install
npm run test

Logs

> npm create svelte@latest my-app
cd my-app
npm install
npm run test

create-svelte version 4.1.0

┌  Welcome to SvelteKit!
│
◇  Which Svelte app template?
│  SvelteKit demo app
│
◇  Add type checking with TypeScript?
│  Yes, using TypeScript syntax
│
◇  Select additional options (use arrow keys/space bar)
│  Add ESLint for code linting, Add Prettier for code formatting, Add Playwright for browser testing, Add Vitest for unit testing
│
└  Your project is ready!

✔ Typescript
  Inside Svelte components, use <script lang="ts">

✔ ESLint
  https://github.com/sveltejs/eslint-plugin-svelte

✔ Prettier
  https://prettier.io/docs/en/options.html
  https://github.com/sveltejs/prettier-plugin-svelte#options

✔ Playwright
  https://playwright.dev

✔ Vitest
  https://vitest.dev

Install community-maintained integrations:
  https://github.com/svelte-add/svelte-add

Next steps:
  1: cd my-app
  2: npm install (or pnpm install, etc)
  3: git init && git add -A && git commit -m "Initial commit" (optional)
  4: npm run dev -- --open

To close the dev server, hit Ctrl-C

Stuck? Visit us at https://svelte.dev/chat

added 231 packages, and audited 232 packages in 23s

47 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> my-app@0.0.1 test
> playwright test

[WebServer] 
[WebServer] "confetti" is imported from external module "@neoconfetti/svelte" but never used in "src/routes/sverdle/+page.svelte".
[WebServer] 
[WebServer] 
Error: No tests found

System Info

System:
    OS: macOS 13.2.1
    CPU: (8) arm64 Apple M2
    Memory: 75.13 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 19.5.0 - ~/.nodenv/versions/19.5.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.3.1 - ~/.nodenv/versions/19.5.0/bin/npm
  Browsers:
    Chrome: 112.0.5615.137
    Chrome Canary: 115.0.5737.0
    Safari: 16.3
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.0.1
    @sveltejs/kit: ^1.5.0 => 1.15.9
    svelte: ^3.54.0 => 3.58.0
    vite: ^4.3.0 => 4.3.3

Severity

annoyance

Additional Information

No response

gtm-nayan commented 1 year ago

Looks like they changed the globs in Playwright 1.33. Gah.