question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Update babel config to include private methods proposal plugin

See original GitHub issue

Could private class fields be added to the babel config for tests? It is included in @babel/preset-env and is a stage 4 proposal now which should be integrated into the standard soon.

Moved from comment in #11440.

$ playwright test
Using config at .../playwright.config.ts

SyntaxError: .../index.ts: Class private methods are not enabled.
  81 |   }
  82 |
> 83 |   get #log() {
     |   ^
  84 |     return this.#logger
  85 |   }
  86 |

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pavelfeldmancommented, Feb 11, 2022

This did not make it into Playwright v1.19, we cut several days ago. So you’ll need to either use @playwright/test@next or wait for v1.20 (mid March).

1reaction
pavelfeldmancommented, Feb 11, 2022

Yep, I can repro. I think I had my test case with the .js extension by accident.

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/plugin-proposal-private-methods
When true, private methods will be assigned directly on its parent via Object.defineProperty rather than a WeakSet . This results in improved performance ......
Read more >
Though the "loose" option was set to "false" in your @babel ...
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the "loose" ...
Read more >
@babel/plugin-proposal-private-methods - npm
This plugin transforms private class methods. Latest version: 7.18.6, last published: 6 months ago.
Read more >
@babel/plugin-proposal-private-methods - Package Manager
@babel/plugin-proposal-private-methods ... This plugin transforms private class methods ... babel. The compiler for writing next generation JavaScript.
Read more >
@babel/plugin-proposal-private-methods - npm package | Snyk
This plugin transforms private class methods For more information about how to use this package see README · Ensure you're using the healthiest...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found