Giter Club home page Giter Club logo

Comments (9)

peterbud avatar peterbud commented on May 24, 2024 1

Sure, I'll rebase the vitest branch to the latest main branch, and I'll open a PR, and we can continue the work there.

from anu.

peterbud avatar peterbud commented on May 24, 2024

I was not sure, to be honest. The reason of those was that I have seen that null values in the slots are converted somewhere in the rendering to <!----> - my guess that it is an issue of the JSX transpiling, but have not tested.

Example:
You hvae a button, and the default slot is 'Click me'

If you have null there as in the original, the button is rendered as (note the two <!----> for each null slot ):

<button style="...">
  <!---->Click me
  <!---->
</button>

if you use empty strings instead of null, these placeholders are not rendered.

<button style="...">Click me</button>

It's really a cosmetic stuff, and I think the original version with the null is the best, just would be nice to render them as empty, instead of such placeholders.

I'll revert back to null.

from anu.

jd-solanki avatar jd-solanki commented on May 24, 2024

Hi @peterbud

I'm ready to learn vitest now. Do you have any fine resources?

Moreover, it will be great if you can suggest a scalable folder structure for Anu's tests.

Thanks.

from anu.

peterbud avatar peterbud commented on May 24, 2024

Normally I read the docs, it's pretty good for vitest.

For the test structure we have options:

  • Either all tests are going to be in a separate "test" folder
  • Or we can also make it work I believe to locate each test next to the component in the respective folder

What would be your preference?

from anu.

jd-solanki avatar jd-solanki commented on May 24, 2024

Ohk, I will start with docs then.

Mostly, I noticed people have separate test folder, 1st option.

from anu.

jd-solanki avatar jd-solanki commented on May 24, 2024

Btw, i must ask as we have component library what's suitable?

from anu.

jd-solanki avatar jd-solanki commented on May 24, 2024

Another option is, should we have tests inside each package instead of single test folder in root πŸ€”

from anu.

peterbud avatar peterbud commented on May 24, 2024

I have also found a good example for component testing for element-plus:
https://github.com/element-plus/element-plus/blob/dev/packages/components/button/__tests__/button.test.tsx

They keep the tests next to each component, and I think it's a good example of what they are testing in the components

from anu.

jd-solanki avatar jd-solanki commented on May 24, 2024

Hmm, That's another approach.

After checking out some other libs I think we should place tests dir in the root, outside of packages, your 1st option.

Can you give us a boost start?

from anu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.