Skip to content

Commit 34357ad

Browse files
committed
docs(README): move links to sections that use them, remove unused links
1 parent 9dce164 commit 34357ad

File tree

1 file changed

+72
-56
lines changed

1 file changed

+72
-56
lines changed

README.md

Lines changed: 72 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@
1212

1313
<p>Simple and complete Svelte testing utilities that encourage good testing practices.</p>
1414

15-
[**Read The Docs**](https://testing-library.com/docs/svelte-testing-library/intro) |
16-
[Edit the docs](https://github.com/testing-library/testing-library-docs)
15+
[**Read The Docs**][stl-docs] | [Edit the docs][stl-docs-repo]
1716

1817
<!-- prettier-ignore-start -->
1918
[![Build Status][build-badge]][build]
2019
[![Code Coverage][coverage-badge]][coverage]
21-
[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends]
20+
[![version][version-badge]][package]
21+
[![downloads][downloads-badge]][downloads]
2222
[![MIT License][license-badge]][license]
2323

24-
[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)
25-
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc]
24+
[![All Contributors][contributors-badge]][contributors]
25+
[![PRs Welcome][prs-badge]][prs]
26+
[![Code of Conduct][coc-badge]][coc]
2627
[![Discord][discord-badge]][discord]
2728

2829
[![Watch on GitHub][github-watch-badge]][github-watch]
@@ -33,6 +34,33 @@
3334

3435
<hr />
3536

37+
[stl-docs]: https://testing-library.com/docs/svelte-testing-library/intro
38+
[stl-docs-repo]: https://github.com/testing-library/testing-library-docs
39+
[build-badge]: https://img.shields.io/github/actions/workflow/status/testing-library/svelte-testing-library/release.yml?style=flat-square
40+
[build]: https://github.com/testing-library/svelte-testing-library/actions
41+
[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/svelte-testing-library.svg?style=flat-square
42+
[coverage]: https://codecov.io/github/testing-library/svelte-testing-library
43+
[version-badge]: https://img.shields.io/npm/v/@testing-library/svelte.svg?style=flat-square
44+
[package]: https://www.npmjs.com/package/@testing-library/svelte
45+
[downloads-badge]: https://img.shields.io/npm/dm/@testing-library/svelte.svg?style=flat-square
46+
[downloads]: http://www.npmtrends.com/@testing-library/svelte
47+
[license-badge]: https://img.shields.io/github/license/testing-library/svelte-testing-library?color=b&style=flat-square
48+
[license]: https://github.com/testing-library/svelte-testing-library/blob/main/LICENSE
49+
[contributors-badge]: https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square
50+
[contributors]: #contributors
51+
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
52+
[prs]: http://makeapullrequest.com
53+
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
54+
[coc]: https://github.com/testing-library/svelte-testing-library/blob/main/CODE_OF_CONDUCT.md
55+
[discord-badge]: https://img.shields.io/discord/723559267868737556.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square
56+
[discord]: https://discord.gg/testing-library
57+
[github-watch-badge]: https://img.shields.io/github/watchers/testing-library/svelte-testing-library.svg?style=social
58+
[github-watch]: https://github.com/testing-library/svelte-testing-library/watchers
59+
[github-star-badge]: https://img.shields.io/github/stars/testing-library/svelte-testing-library.svg?style=social
60+
[github-star]: https://github.com/testing-library/svelte-testing-library/stargazers
61+
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20svelte-testing-library%20by%20%40@TestingLib%20https%3A%2F%2Fgithub.com%2Ftesting-library%2Fsvelte-testing-library%20%F0%9F%91%8D
62+
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/testing-library/svelte-testing-library.svg?style=social
63+
3664
## Table of Contents
3765

3866
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
@@ -41,31 +69,35 @@
4169
- [The Problem](#the-problem)
4270
- [This Solution](#this-solution)
4371
- [Installation](#installation)
72+
- [Setup](#setup)
4473
- [Docs](#docs)
74+
- [Core](#core)
4575
- [Issues](#issues)
4676
- [🐛 Bugs](#-bugs)
4777
- [💡 Feature Requests](#-feature-requests)
4878
- [❓ Questions](#-questions)
4979
- [Contributors](#contributors)
50-
- [LICENSE](#license)
5180

5281
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
5382

5483
## The Problem
5584

56-
You want to write tests for your Svelte components so that they avoid including implementation
57-
details, and are maintainable in the long run.
85+
You want to write maintainable tests for your [Svelte][svelte] components.
86+
87+
[svelte]: https://svelte.dev/
5888

5989
## This Solution
6090

61-
The `svelte-testing-library` is a very lightweight solution for testing Svelte
62-
components. It provides light utility functions on top of `svelte` and
63-
`dom-testing-library`, in a way that encourages better testing practices. Its
64-
primary guiding principle is:
91+
`@testing-library/svelte` is a lightweight library for testing Svelte
92+
components. It provides functions on top of `svelte` and
93+
`@testing-library/dom` so you can mount Svelte components and query their
94+
rendered output in the DOM. Its primary guiding principle is:
6595

6696
> [The more your tests resemble the way your software is used, the more
6797
> confidence they can give you.][guiding-principle]
6898
99+
[guiding-principle]: https://twitter.com/kentcdodds/status/977018512689455106
100+
69101
## Installation
70102

71103
This module is distributed via [npm][npm] which is bundled with [node][node] and
@@ -77,12 +109,18 @@ npm install --save-dev @testing-library/svelte
77109

78110
This library supports `svelte` versions `3`, `4`, and `5`.
79111

80-
You may also be interested in installing `@testing-library/jest-dom` so you can use
81-
[the custom jest matchers](https://github.com/testing-library/jest-dom).
112+
You may also be interested in installing `@testing-library/jest-dom` so you can
113+
use [the custom jest matchers][jest-dom].
114+
115+
[npm]: https://www.npmjs.com/
116+
[node]: https://nodejs.org
117+
[jest-dom]: https://github.com/testing-library/jest-dom
82118

83119
## Setup
84120

85-
We recommend using `@testing-library/svelte` with [Vitest][] as your test runner. To get started, add the `svelteTesting` plugin to your Vite or Vitest config.
121+
We recommend using `@testing-library/svelte` with [Vitest][] as your test
122+
runner. To get started, add the `svelteTesting` plugin to your Vite or Vitest
123+
config.
86124

87125
```diff
88126
// vite.config.js
@@ -97,33 +135,48 @@ We recommend using `@testing-library/svelte` with [Vitest][] as your test runner
97135
});
98136
```
99137

100-
See the [setup docs][] for more detailed setup instructions, including for other test runners like Jest.
138+
See the [setup docs][] for more detailed setup instructions, including for other
139+
test runners like Jest.
101140

102141
[vitest]: https://vitest.dev/
103142
[setup docs]: https://testing-library.com/docs/svelte-testing-library/setup
104143

105144
## Docs
106145

107-
See the [**docs**](https://testing-library.com/docs/svelte-testing-library/intro) over at the Testing Library website.
146+
See the [**docs**][stl-docs] over at the Testing Library website.
147+
148+
## Core
149+
150+
Are you building your own Svelte testing library? Check out our
151+
[low-level core][core], which provides Svelte-version-agnostic methods for
152+
rendering components.
153+
154+
[core]: ./src/core
108155

109156
## Issues
110157

111158
_Looking to contribute? Look for the [Good First Issue][good-first-issue]
112159
label._
113160

161+
[good-first-issue]: https://github.com/testing-library/svelte-testing-library/issues?utf8=✓&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3A"good+first+issue"+
162+
114163
### 🐛 Bugs
115164

116165
Please file an issue for bugs, missing documentation, or unexpected behavior.
117166

118167
[**See Bugs**][bugs]
119168

169+
[bugs]: https://github.com/testing-library/svelte-testing-library/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Acreated-desc
170+
120171
### 💡 Feature Requests
121172

122173
Please file an issue to suggest new features. Vote on feature requests by adding
123174
a 👍. This helps maintainers prioritize what to work on.
124175

125176
[**See Feature Requests**][requests]
126177

178+
[requests]: https://github.com/testing-library/svelte-testing-library/issues?q=is%3Aissue+sort%3Areactions-%2B1-desc+label%3Aenhancement+is%3Aopen
179+
127180
### ❓ Questions
128181

129182
For questions related to using the library, please visit a support community
@@ -132,6 +185,8 @@ instead of filing an issue on GitHub.
132185
- [Discord][discord]
133186
- [Stack Overflow][stackoverflow]
134187

188+
[stackoverflow]: https://stackoverflow.com/questions/tagged/svelte-testing-library
189+
135190
## Contributors
136191

137192
Thanks goes to these people ([emoji key][emojis]):
@@ -173,44 +228,5 @@ Thanks goes to these people ([emoji key][emojis]):
173228
This project follows the [all-contributors][all-contributors] specification.
174229
Contributions of any kind welcome!
175230

176-
## LICENSE
177-
178-
[MIT](LICENSE)
179-
180-
<!-- prettier-ignore-start -->
181-
182-
[npm]: https://www.npmjs.com/
183-
[node]: https://nodejs.org
184-
[build-badge]: https://img.shields.io/github/actions/workflow/status/testing-library/svelte-testing-library/release.yml?style=flat-square
185-
[build]: https://github.com/testing-library/svelte-testing-library/actions
186-
[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/svelte-testing-library.svg?style=flat-square
187-
[coverage]: https://codecov.io/github/testing-library/svelte-testing-library
188-
[version-badge]: https://img.shields.io/npm/v/@testing-library/svelte.svg?style=flat-square
189-
[package]: https://www.npmjs.com/package/@testing-library/svelte
190-
[downloads-badge]: https://img.shields.io/npm/dm/@testing-library/svelte.svg?style=flat-square
191-
[npmtrends]: http://www.npmtrends.com/@testing-library/svelte
192-
[discord-badge]: https://img.shields.io/discord/723559267868737556.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square
193-
[discord]: https://discord.gg/testing-library
194-
[license-badge]: https://img.shields.io/github/license/testing-library/svelte-testing-library?color=b&style=flat-square
195-
[license]: https://github.com/testing-library/svelte-testing-library/blob/main/LICENSE
196-
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
197-
[prs]: http://makeapullrequest.com
198-
[donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square
199-
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
200-
[coc]: https://github.com/testing-library/svelte-testing-library/blob/main/CODE_OF_CONDUCT.md
201-
[github-watch-badge]: https://img.shields.io/github/watchers/testing-library/svelte-testing-library.svg?style=social
202-
[github-watch]: https://github.com/testing-library/svelte-testing-library/watchers
203-
[github-star-badge]: https://img.shields.io/github/stars/testing-library/svelte-testing-library.svg?style=social
204-
[github-star]: https://github.com/testing-library/svelte-testing-library/stargazers
205-
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20svelte-testing-library%20by%20%40@TestingLib%20https%3A%2F%2Fgithub.com%2Ftesting-library%2Fsvelte-testing-library%20%F0%9F%91%8D
206-
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/testing-library/svelte-testing-library.svg?style=social
207231
[emojis]: https://github.com/all-contributors/all-contributors#emoji-key
208232
[all-contributors]: https://github.com/all-contributors/all-contributors
209-
[set-immediate]: https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate
210-
[guiding-principle]: https://twitter.com/kentcdodds/status/977018512689455106
211-
[bugs]: https://github.com/testing-library/svelte-testing-library/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Acreated-desc
212-
[requests]: https://github.com/testing-library/svelte-testing-library/issues?q=is%3Aissue+sort%3Areactions-%2B1-desc+label%3Aenhancement+is%3Aopen
213-
[good-first-issue]: https://github.com/testing-library/svelte-testing-library/issues?utf8=✓&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3A"good+first+issue"+
214-
[stackoverflow]: https://stackoverflow.com/questions/tagged/svelte-testing-library
215-
216-
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)