vitest icon indicating copy to clipboard operation
vitest copied to clipboard

docs: restructure docs api into three sections

Open sheremet-va opened this issue 3 years ago • 7 comments

I think splitting API into three separate sections makes it easier to access information.

But I can't come up with text for /api/index, so I just deleted it :S

sheremet-va avatar Jun 13 '22 17:06 sheremet-va

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
Latest commit 5305dfefa86c81f30e7560ae9a6ab1a894f7205c
Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/62a77a4179e76800091bed1f
Deploy Preview https://deploy-preview-1478--vitest-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jun 13 '22 17:06 netlify[bot]

We are having the same issue in the Vite docs. The problem is that when you separate the API or Config section then the users can no longer see the full surface in a single page (to search with Cmd+f for example, even if there is algolia available). For Vite, we decided that the index would be the same as Vue: https://vuejs.org/api/

image

This is great because it gives users a complete list of the API + it gives you something to put in the index.

About the partition, should the Mock instance methods and properties also be split?

patak-dev avatar Jun 13 '22 18:06 patak-dev

Not sure if this solution will work nicely with the count of expect's API methods 🤔

sheremet-va avatar Jun 13 '22 18:06 sheremet-va

Why? Check out the vue page, there are tons of methods there and look ok to me 🤔

patak-dev avatar Jun 13 '22 18:06 patak-dev

Why? Check out the vue page, there are tons of methods there and look ok to me 🤔

They are nicecly divided in Vue, but currently expect methods are just a list of 55 methods 👀

sheremet-va avatar Jun 13 '22 18:06 sheremet-va

Maybe the expect methods could be categorized a bit, at least for this API reference. For example:

not toBe toBeCloseTo toBeDefined toBeUndefined toBeTruthy toBeFalsy toBeNull toBeNaN toBeTypeOf toBeInstanceOf

toBeGreaterThan toBeGreaterThanOrEqual toBeLessThan toBeLessThanOrEqual toEqual toStrictEqual

toContain toContainEqual toHaveLength toHaveProperty

toMatch toMatchObject toMatchSnapshot toMatchInlineSnapshot

toThrowError toThrowErrorMatchingSnapshot toThrowErrorMatchingInlineSnapshot

toHaveBeenCalled toHaveBeenCalledTimes toHaveBeenCalledWith toHaveBeenLastCalledWith toHaveBeenNthCalledWith toHaveReturned toHaveReturnedTimes toHaveReturnedWith toHaveLastReturnedWith toHaveNthReturnedWith

toSatisfy resolves rejects expect.assertions expect.hasAssertions expect.addSnapshotSerializer expect.extend

patak-dev avatar Jun 13 '22 18:06 patak-dev

The /api/index should be a simple index of those three sections. Other than that I am good for it

antfu avatar Jul 01 '22 09:07 antfu

Close due to conflicts but I agree to do so. Next time when we want to do this, we could directly push to main branch to avoid conflicts.

antfu avatar Nov 07 '22 13:11 antfu