Skip to content

Commit

Permalink
Initialise Svelte Jest adder
Browse files Browse the repository at this point in the history
  • Loading branch information
rossyman committed Mar 29, 2021
1 parent fe9ae34 commit 831d2af
Show file tree
Hide file tree
Showing 7 changed files with 345 additions and 75 deletions.
79 changes: 6 additions & 73 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand All @@ -15,34 +12,9 @@ pids
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
# Dependencies
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
package-lock.json

# TypeScript cache
*.tsbuildinfo
Expand All @@ -53,52 +25,13 @@ typings/
# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
# IDE Specific files
.idea/
.vscode/
.history/
84 changes: 82 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,82 @@
# svelte-add-jest
SvelteKit adder for Jest unit testing
<h1 align="center">Welcome to svelte-add-jest 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
<a href="https://github.com/rossyman/svelte-add-jest/blob/main/LICENSE" target="_blank">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
</a>
</p>

## ❓ What is this?

This is an **experimental** command to run to add Jest to your SvelteKit project.

## 🛠 Usage

You must start with a fresh copy of the official SvelteKit template, which is currently created by running this command:

```sh
npm init svelte@next
```

Once that is set up, run this command in your project directory to set up Jest:

```sh
npx svelte-add jest
```

After the preset runs,

- You can apply _another_ [Svelte Adder](https://github.com/svelte-add/svelte-adders) to your project for more functionality.

### ⚙️ Options

| Description | Flag | Negated | Default |
|----------------------|-----------------------------|--------------------------------|-----------------|
| Interactive Mode | `--interaction` | `--no-interaction` | True |
| Jest DOM Support | `--jest-dom` | `--no-jest-dom` | True |
| Generate Example | `--examples` | `--no-examples` | True |

## 👀 See Also

- [Svelte Testing Library Docs](https://testing-library.com/docs/svelte-testing-library/intro/)
- [Jest DOM](https://github.com/testing-library/jest-dom#usage)
- [Jest](https://jestjs.io)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/rossyman/svelte-add-jest/issues).

### 😵 Help! I have a question

[Create an issue](https://github.com/svelte-add/jest/issues/new) and we'll try to help.

### 😡 Fix! There is something that needs improvement

[Create an issue](https://github.com/rossyman/svelte-add-jest/issues/new) or [pull request](https://github.com/rossyman/svelte-add-jest/pulls) and we'll try to fix.

These are new tools, so there are likely to be problems in this project. Thank you for bringing them to our attention or fixing them for us.

## Show your support

Give a ⭐️ if this project helped you!

## Author

👤 **Ross MacPhee**

- Twitter: [@rossco___](https://twitter.com/rossco___)
- Github: [@rossyman](https://github.com/rossyman)
- LinkedIn: [@ross-macphee](https://linkedin.com/in/ross-macphee)

👤 **Brady Wiggins**

- Github: [@FractalHQ](https://github.com/FractalHQ)

## 📝 License

Copyright © 2021 - Ross MacPhee & Brady Wiggins.<br />
This project is [MIT](https://github.com/rossyman/svelte-add-jest/blob/main/LICENSE) licensed.

---

_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"private": true,
"name": "@rossyman/svelte-add-jest",
"version": "1.0.0",
"description": "SvelteKit adder for Jest unit testing",
"license": "MIT",
"keywords": [
"svelte",
"sveltekit",
"svelte-kit",
"jest",
"unit-test",
"test"
],
"repository": "github:rossyman/svelte-add-jest",
"bugs": "https://github.com/rossyman/svelte-add-jest/issues",
"contributors": [
"Ross MacPhee (https://github.com/rossyman)",
"Brady Wiggins (https://github.com/FractalHQ)"
],
"preset": "preset.ts",
"devDependencies": {
"apply": "^0.2.13"
}
}
Loading

0 comments on commit 831d2af

Please sign in to comment.