modernweb-dev / web

Guides, tools and libraries for modern web development.
https://modern-web.dev
MIT License
2.22k stars 288 forks source link

[test-runner] doesn't detect newly created files while running (with `--watch`) #2135

Open jpzwarte opened 1 year ago

jpzwarte commented 1 year ago
  1. Start wtr --watch
  2. Create a new test file
  3. wtr doesn't see the new file
  4. restart wtr for it to see the new file
jpzwarte commented 1 year ago

Not sure if it matters, but this is with @web/dev-server-esbuild.

My web-test-runner.config.mjs:

// @ts-check
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { playwrightLauncher } from '@web/test-runner-playwright';

/** @type {import('@web/test-runner').TestRunnerConfig} */
const config = {
  nodeResolve: true,

  files: ['src/**/*.spec.ts'],

  browsers: [playwrightLauncher({ product: 'chromium' })],
  plugins: [esbuildPlugin({ ts: true, target: 'auto' })],

  testRunnerHtml: testFramework => `
    <html>
      <body>
        <script src="/node_modules/@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js"></script>
        <script type="module" src="${testFramework}"></script>
      </body>
    </html>
  `
};

export default config;