jacketattack / blackjack-is-fun

GNU General Public License v3.0
2 stars 0 forks source link

Add react tests and babel configuration #9

Closed Incognito0989 closed 6 months ago

Incognito0989 commented 9 months ago

Some basic view tests using react testing library and jest. Babel was used to bypass errors coming from "import.meta.url"

This PR is for review as not all tests have been complete. I would also like to go back and see if babel can be removed :)

jacketattack commented 8 months ago

what needs to be completed before this can leave draft mode and be made ready for review?

Incognito0989 commented 8 months ago

FAIL src/components/app/app.test.tsx ● Test suite failed to run

src/components/card-image/card-image.tsx:8:17 - error TS2322: Type 'URL' is not assignable to type 'string'.

8     return <img src={getUrlOfCard(props.card)} height="200" width="100"/>;
                  ~~~

  node_modules/@types/react/index.d.ts:2188:9
    2188         src?: string | undefined;
                 ~~~
    The expected type comes from property 'src' which is declared here on type 'DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>'
src/components/card-image/card-image.tsx:12:79 - error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.

12     '2_of_diamonds': new URL('../../../public/card_images/2_of_diamonds.png', import.meta.url),
                                                                                 ~~~~~~~~~~~
src/components/card-image/card-image.tsx:13:75 - error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.

13     '2_of_hearts': new URL('../../../public/card_images/2_of_hearts.png', import.meta.url),
                                                                             ~~~~~~~~~~~
src/components/card-image/card-image.tsx:14:73 - error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.
vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blackjack-is-fun ❌ Failed (Inspect) Mar 26, 2024 10:34pm
jacketattack commented 7 months ago

@Incognito0989 you need to correct your git config for this repo on your machine to ensure commits are being associated with your github account. See below they are currently not. Being associated with another account named 'ajones'

image
jacketattack commented 7 months ago

Great tests! very readable 👏

Incognito0989 commented 7 months ago

i am not able to see the vercel extra details. would love in depth analysis next meet