solidjs / create-solid

Set up a modern web app by running one command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

generated test doesn't work.

jfgodoy opened this issue · comments

The generated test doesn't work.

I created a solid app with

npm init solid app my-app

then run the test with

npm test -- src/App.test.js

and I get this:

 FAIL  src/App.test.js
  ● Test suite failed to run

    Cannot find module 'dom' from 'App.js'

    However, Jest was able to find:
    	'./App.css'
    	'./App.js'
    	'./App.test.js'

    You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'ts', 'tsx', 'json', 'jsx', 'node'].

    See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string

       6 |     <div class="App">
       7 |       <header class="App-header">
    >  8 |         <img src={logo} class="App-logo" alt="logo" />
         |            ^
       9 |         <p>
      10 |           Edit <code>src/App.js</code> and save to reload.
      11 |         </p>

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17)
      at Object.<anonymous> (src/App.js:8:12)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.759s
Ran all test suites matching /src\/App.test.js/i.

Thanks for reporting. I see the issue, I will let you know when I've deployed the fix.

Yeah when I made the big update to 0.9.0 I updated the webpack config but not the jest config. I'm just retesting right now on the release (which takes a few min to run through) but I believe solid-scripts 0.0.18 fixes the issue. Should be able to just update your package.json and reinstall.

EDIT:
Yeah looks good. Let me know if there any other issues.

thank you @ryansolid for the quick solution and congratulations on the amazing work done in the solid library.