Skip to content

Commit f97b690

Browse files
author
Ben Monro
committed
no message
1 parent eaf9718 commit f97b690

File tree

2 files changed

+26
-57
lines changed

2 files changed

+26
-57
lines changed

README.md

Lines changed: 26 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,39 @@
1-
*Psst — looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)*
1+
### svelte-testing-library
22

3-
---
3+
**_WIP_**
44

5-
# svelte app
5+
## Installation
66

7-
This is a project template for [Svelte](https://svelte.technology) apps. It lives at https://github.com/sveltejs/template.
7+
`npm i -D svelte-testing-library`
88

9-
To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit):
9+
## Usage
1010

11-
```bash
12-
npx degit sveltejs/template svelte-app
13-
cd svelte-app
14-
```
15-
16-
*Note that you will need to have [Node.js](https://nodejs.org) installed.*
17-
18-
19-
## Get started
20-
21-
Install the dependencies...
22-
23-
```bash
24-
cd svelte-app
25-
npm install
26-
```
27-
28-
...then start [Rollup](https://rollupjs.org):
29-
30-
```bash
31-
npm run dev
32-
```
11+
App.svelte
3312

34-
Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.
13+
```html
14+
<script>
15+
export let name;
16+
</script>
3517

18+
<style>
19+
h1 {
20+
color: purple;
21+
}
22+
</style>
3623

37-
## Deploying to the web
38-
39-
### With [now](https://zeit.co/now)
40-
41-
Install `now` if you haven't already:
42-
43-
```bash
44-
npm install -g now
45-
```
46-
47-
Then, from within your project folder:
48-
49-
```bash
50-
now
24+
<h1>Hello {name}!</h1>
5125
```
5226

53-
As an alternative, use the [Now desktop client](https://zeit.co/download) and simply drag the unzipped project folder to the taskbar icon.
54-
55-
### With [surge](https://surge.sh/)
56-
57-
Install `surge` if you haven't already:
58-
59-
```bash
60-
npm install -g surge
61-
```
27+
App.spec.js
6228

63-
Then, from within your project folder:
29+
```javascript
30+
import App from "../src/App.svelte";
31+
import { render } from "../src";
32+
describe("App", () => {
33+
test("should render", () => {
34+
const { getByText } = render(App, { name: "world" });
6435

65-
```bash
66-
npm run build
67-
surge public
36+
expect(getByText("Hello world!"));
37+
});
38+
});
6839
```

tests/queries.spec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// const App = require("../src/App.svelte");
2-
// const { render } = require("../src");
31
import App from "../src/example/App.svelte";
42
import { render } from "../src";
53
describe("App", () => {

0 commit comments

Comments
 (0)