Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jacobhsu/unit-testing-vue


https://github.com/jacobhsu/unit-testing-vue

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# unit-testing-vue

Vue CLI v3.0.3
? Target directory D:\Jacob\github\unit-testing-vue already exists. Pick an action: `Merge`

Vue CLI v3.0.3
? Please pick a preset: `Manually select features`
? Check the features needed for your project: `Babel, Router, Vuex, Linter, Unit`
? Use history mode for router? (Requires proper server setup for index fallback in production) `Yes`
? Pick a linter / formatter config: `Prettier`
? Pick additional lint features: `Lint on save`
? Pick a unit testing solution: `Jest`
? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? `In dedicated config files`
? Save this as a preset for future projects? `No`

[.prettierrc.js](https://prettier.io/docs/en/configuration.html)

```js
module.exports = {
singleQuote: true,
semi: false
}
```

`$ yarn test:unit`

https://www.vuemastery.com/courses/unit-testing/writing-a-unit-test-with-jest/
https://www.vuemastery.com/courses/unit-testing/Testing-Props-and-User-Interaction

## testing-api-calls

@vue/cli-plugin-unit-jest" ^3.0.3
:::error::: getMessage.mockResolvedValueOnce FAIL

`yarn add @vue/cli-plugin-unit-jest@^4.1.0`

## json-server

`$ json-server --watch db.json`

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn run serve
```

### Compiles and minifies for production
```
yarn run build
```

### Lints and fixes files
```
yarn run lint
```

### Run your unit tests
```
yarn run test:unit
```