Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore and automate airtap testing #2004

Open
mcollina opened this issue Jul 12, 2024 · 3 comments
Open

Restore and automate airtap testing #2004

mcollina opened this issue Jul 12, 2024 · 3 comments
Labels

Comments

@mcollina
Copy link
Member

Currently our npm run browser-test is not working anymore.

I've tried to adding it back via playwright, but stumbled on:

# fatal logs
client error (Playwright Chromium): {
  message: 'Uncaught TypeError: Cannot redefine property: error',
  source: 'http://localhost:52401/airtap/test.js',
  lineno: 15382,
  colno: 10,
  error: {
    name: 'TypeError',
    stack: 'TypeError: Cannot redefine property: error\n' +
      '    at Function.defineProperty (<anonymous>)\n' +
      '    at sink (http://localhost:52401/airtap/test.js:15382:10)\n' +
      '    at Test.<anonymous> (http://localhost:52401/airtap/test.js:15257:5)\n' +
      '    at Test.run (http://localhost:52401/airtap/test.js:12264:28)\n' +
      '    at next (http://localhost:52401/airtap/test.js:12055:7)\n' +
      '    at onNextTick (http://localhost:52401/airtap/test.js:13194:12)\n' +
      '    at Item.run (http://localhost:52401/airtap/test.js:8197:14)\n' +
      '    at drainQueue (http://localhost:52401/airtap/test.js:8167:42)'
  }
}

This the config file I'm trying:

➜  pino git:(main) ✗ cat .airtap.yml
providers:
  - airtap-playwright

browsers:
  - name: chromium

cc @vweevers

@vweevers
Copy link

Both the pino test and airtap override console.error (here and here). Airtap wraps and calls the original function so that should not be a problem. Pino only intercepts a single call and then restores the original function, which I think should work fine as well. Both use simple assignment (console.error = x). Hm.

Would recommend debugging it, which is easiest with a non-headless browser, e.g. using airtap-default.

@mcollina
Copy link
Member Author

Where does airtap does the wrapping? Might it be that it defines the fields in a non-writable way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants