Zaid-Ajaj / Feliz

A fresh retake of the React API in Fable and a collection of high-quality components to build React applications in F#, optimized for happiness
https://zaid-ajaj.github.io/Feliz/
MIT License
534 stars 78 forks source link

npm test fails #543

Open jkone27 opened 1 year ago

jkone27 commented 1 year ago

npm test command fails after adding global.json to target NET6 (LTS) and adjusting fsproj test file to net6

Project and references (62 source files) parsed in 203ms

Loaded Feliz.HookAttribute from ../../../.nuget/packages/feliz.compilerplugins/1.10.0/lib/netstandard2.0/Feliz.CompilerPlugins.dll
Loaded Feliz.ReactComponentAttribute from ../../../.nuget/packages/feliz.compilerplugins/1.10.0/lib/netstandard2.0/Feliz.CompilerPlugins.dll
Loaded Feliz.ReactMemoComponentAttribute from ../../../.nuget/packages/feliz.compilerplugins/1.10.0/lib/netstandard2.0/Feliz.CompilerPlugins.dll
Started Fable compilation...
Fable compilation finished in 9932ms                                                

TypeError: Invalid host defined options
    at formattedImport (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/mocha/lib/esm-utils.js:6:23)
    at exports.requireOrImport (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/mocha/lib/esm-utils.js:23:14)
    at exports.loadFilesAsync (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/mocha/lib/esm-utils.js:33:34)
    at Mocha.loadFilesAsync (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/mocha/lib/mocha.js:431:19)
    at singleRun (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/mocha/lib/cli/run-helpers.js:125:15)
    at exports.runMocha (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/mocha/lib/cli/run-helpers.js:190:10)
    at exports.handler (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/mocha/lib/cli/run.js:362:11)
    at /Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/yargs/lib/command.js:241:49
    at process.runNextTicks [as _tickCallback] (node:internal/process/task_queues:60:5)
    at /Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/esm/esm.js:1:34535
    at /Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/esm/esm.js:1:34176
    at process.<anonymous> (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/esm/esm.js:1:34506)
    at Function.<anonymous> (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/esm/esm.js:1:296856)
    at Function.<anonymous> (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/esm/esm.js:1:296555)
    at Function.<anonymous> (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/esm/esm.js:1:284879)
    at Object.apply (/Users/admin/Repositories/fable-tests/react-fsharp-feliz/node_modules/esm/esm.js:1:199341)
    at node:internal/main/run_main_module:23:47

when i run npm test with NET6 (had to change it as was referencing NET5)

jkone27 commented 1 year ago

seems related to this error: https://github.com/mochajs/mocha/issues/4594. ? is it possible to use jest instead of mocha?

Zaid-Ajaj commented 1 year ago

@jkone27 mocha probably needs an update. It is possible to use jest but favouring mocha because it runs the tests in the actual browser. That is when they used to work so I appreciate you looking into making it work again 🙏