You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seem to be issues ( google search] in Node around dynamic imports. It seems to more prevalent with newer version of Node. Jest specifically will segfault on these. The line in question in mo-walk is:
Run a simple hapipal init as outlined in the Quick Start
npm init @hapipal my-project
cd ./my-project
npm install
Inside my-project add the following route at test at the following paths:
// <root>/test/ping.test.jsconstServer=require('../server');// Start application before running the test caseletserver=null;beforeAll(async()=>{});// Stop application after running the test caseafterAll(async()=>{if(server){awaitserver.stop();}});test('should ping tests',async()=>{server=awaitServer.deployment();console.log('Server is running');constoptions={method: 'GET',url: '/ping',};constdata=awaitserver.inject(options);expect(data.statusCode).toBe(200);});
Add test:jest to the package.json scripts area: "test:jest": "NODE_ENV=test jest --verbose",
Run the test: npm run test:jest test/ping.test.js
I also recommend clearing out your node_modules and re-installing so you have a clean install.
This issue make it so that hapi-pal can't be used either as it uses HC, so this is a cascading effect. Lab doesn't seem to demonstrate this issue, however even though Jest does, I have also recreated this with Mocha.
The text was updated successfully, but these errors were encountered:
For haute-couture to support ESM we need to use dynamic imports, so unfortunately I don't think there's a lot we can do on this side to fix the issue. This affects a bunch of projects, and sounds like some combination of the nodejs, v8, and jest teams are working it out together: nodejs/node#35889jestjs/jest#11438
In the meantime there's a chance you can work around the issue by changing the contents of lib/index.js so that the file extension of the .hc.js file isn't inferred by haute-couture:
Haute-Conture 4.2+ uses
mo-walk
.There seem to be issues ( google search] in Node around dynamic imports. It seems to more prevalent with newer version of Node. Jest specifically will segfault on these. The line in question in
mo-walk
is:https://github.com/devinivy/mo-walk/blob/main/lib/index.js#L157
Steps to Reproduce
hapipal
init as outlined in the Quick Startmy-project
add the following route at test at the following paths:npm i jest
test:jest
to thepackage.json
scripts area:"test:jest": "NODE_ENV=test jest --verbose",
npm run test:jest test/ping.test.js
I also recommend clearing out your
node_modules
and re-installing so you have a clean install.This issue make it so that hapi-pal can't be used either as it uses HC, so this is a cascading effect. Lab doesn't seem to demonstrate this issue, however even though Jest does, I have also recreated this with Mocha.
The text was updated successfully, but these errors were encountered: