diff --git a/src/content/docs/en/reference/publish-to-npm.mdx b/src/content/docs/en/reference/publish-to-npm.mdx index 45d877209d65d..1da709523cfae 100644 --- a/src/content/docs/en/reference/publish-to-npm.mdx +++ b/src/content/docs/en/reference/publish-to-npm.mdx @@ -3,6 +3,7 @@ title: Publish to NPM description: Learn how to publish Astro components to NPM i18nReady: true --- +import { Steps } from '@astrojs/starlight/components'; import { FileTree } from '@astrojs/starlight/components'; Building a new Astro component? **Publish it to [npm!](https://npmjs.com/)** @@ -233,17 +234,22 @@ Astro does not currently ship a test runner. _(If you are interested in helping In the meantime, our current recommendation for testing is: + 1. Add a test `fixtures` directory to your `demo/src/pages` directory. + 2. Add a new page for every test that you'd like to run. + 3. Each page should include some different component usage that you'd like to test. + 4. Run `astro build` to build your fixtures, then compare the output of the `dist/__fixtures__/` directory to what you expected. + + - my-project/demo/src/pages/\_\_fixtures\_\_/ + - test-name-01.astro + - test-name-02.astro + - test-name-03.astro + + - -- my-project/demo/src/pages/\_\_fixtures\_\_/ - - test-name-01.astro - - test-name-02.astro - - test-name-03.astro - ## Publishing your component