How to use [email protected] with Node.js 12.16.1 #3005
-
I have project which uses ava version 2.4.0, we are planning to migrate to 4.1.0 to make use of webworker threads which would increase the unit test performance also shared workers concept. But based on the documentation it seems, 4.1.0 is only supported for ESM based projects alone. I have sample project which i'm trying to run, it always throws
Is it not possible at all to use ava with Node.js version 12.16.1 ? Sample Project: https://github.com/sathishsoundharajan/ava-check |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
AVA 4 requires 12.22, it may work on older version but I'm not sure. It does work with CommonJS though, but most internals are ESM and that requires a more recent Node.js version. The same goes for worker threads I believe. Node.js 12 is end of life this month, and there have been numerous vulnerability fixes you're already missing out on. |
Beta Was this translation helpful? Give feedback.
-
@novemberborn Thanks for the answer.. yeah most internals are ESM so i believe i cannot use the Ava 4. Sadly, it is not simple migration for the service i'm working :( |
Beta Was this translation helpful? Give feedback.
-
@novemberborn I can migrate to Ava 3+ version, where i can make use of shared workers. But i have very basic question on shared workers. Let's say i have hapijs server, which i create it as part of shared context thread and reuse it for the all test case files, how would end up doing it ? I went through the @ava/get-port code, i see that we are using context.reserve to lock the primitive port numbers. In my case i don't need to lock anything, it just i want hapijs server composed and ready to be used in context so each file can use it while running.. Is this something possible with sharedworkers ? OR Am i missing very basic understanding itself |
Beta Was this translation helpful? Give feedback.
@novemberborn I can migrate to Ava 3+ version, where i can make use of shared workers. But i have very basic question on shared workers.
Let's say i have hapijs server, which i create it as part of shared context thread and reuse it for the all test case files, how would end up doing it ? I went through the @ava/get-port code, i see that we are using context.reserve to lock the primitive port numbers. In my case i don't need to lock anything, it just i want hapijs server composed and ready to be used in context so each file can use it while running..
Is this something possible with sharedworkers ? OR Am i missing very basic understanding itself