Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/tkraak/intro-unit-test

:circus_tent: Workshop: Intro to unit testing with AVA
https://github.com/tkraak/intro-unit-test

ava javascript learn testing unit-test unit-testing

Last synced: 9 days ago
JSON representation

:circus_tent: Workshop: Intro to unit testing with AVA

Awesome Lists containing this project

README

        

# Introduction to writing unit tests with AVA

This repository serves as a gentle introduction to writing JavaScript [unit](https://dev.to/jackmarchant/no-excuses-write-unit-tests) tests with [AVA](https://github.com/avajs/ava).

The `getAmount()` function and the motivation to refactor it were taken from NodeSchool's [JavaScript Best Practices workshop](https://github.com/excellalabs/js-best-practices-workshopper).

The `orderTotal()` function was taken from the [Fun Fun Function](https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q) video series on [Unit Tesing in JavaScript](https://www.youtube.com/playlist?list=PL0zVEGEvSaeF_zoW9o66wa_UCNE3a7BEr). Thanks @mpj!

## Getting started

- fork and clone this repo
- `npm install` or `yarn install`
- `npm test` to lint with [standard](https://standardjs.com) and run the tests with [AVA](https://github.com/avajs/ava)
- `npm run lint` to lint only
- happy learning ... pull requests welcome!