[Feature] Update babel config to include private methods proposal plugin
See original GitHub issueCould 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:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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).
Yep, I can repro. I think I had my test case with the .js extension by accident.