Skip to content

Commit

Permalink
clarify use of Tap for #34
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Oct 23, 2018
1 parent 04a8343 commit eca0a8c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
22 changes: 14 additions & 8 deletions README.md
Expand Up @@ -14,7 +14,9 @@
A *Beginner's Guide* to Test Driven Development (TDD) using ***Tape***
and ***Tap*** including front-end testing!

<a href="https://youtu.be/epPS_DjEWWY?t=32" <!-- why Volvo cars are so safe! -->
<a href="https://youtu.be/epPS_DjEWWY?t=32"
alt="Volvo cars are safer because they learn from every real world crash!">
<!-- why Volvo cars are so safe! -->
<img src="https://user-images.githubusercontent.com/194400/47100041-7bac0600-d22e-11e8-97c6-319f454efde5.jpg"
alt="Car Designers follow a Testing Mindset">
</a>
Expand All @@ -23,7 +25,7 @@ and ***Tap*** including front-end testing!
<br />

> <small>
**Note**: if you are ***new to Test Driven Development*** (TDD),
**Note**: if you are ***new to Test Driven Development*** (TDD), <br />
consider reading our _general **beginner's introduction**_:
[https://github.com/dwyl/**learn-tdd**](https://github.com/dwyl/learn-tdd)
</small>
Expand Down Expand Up @@ -581,26 +583,30 @@ node_js:
- "node"
```

And _enable_ the project on Traivs-CI.
And _enable_ the project on Traivs-CI. <br />
**Done**. [![Build Status](https://img.shields.io/travis/dwyl/learn-tape/master.svg?style=flat-square)](https://travis-ci.org/dwyl/learn-tape)

<br />



### Can We Use Tape for _Frontend_ Tests?
# Can We Use Tape for _Frontend_ Tests?

Now that you've learned how to use Tape to test your back end code
check out our guide on
[frontend testing with tape](https://github.com/dwyl/learn-tape/blob/master/front-end-with-tape.md).


## What about _Tap_?
# What about _Tap_?

We use **Tape** for _most_ of our JavaScript testing needs
[@dwyl](https://github.com/dwyl?language=javascript)
but _occasionally_ we find that having a few _specific_ extra functions
simplifies our tests and reduces the repetitive "boilerplate".
_simplifies_ our tests and reduces the repetitive "boilerplate".

If you find yourself needing a `before` or `after` function
If you find yourself needing a **`before`** or **`after`** function
to do "setup", "teardown" or resetting state in tests,
***or*** you need to run tests in ***parallel***
(_because you have lots of tests_),
then _consider_ using ***`Tap`***:
then _consider_ using **`Tap`**:
[**`tap-advanced-testing.md`**](https://github.com/dwyl/learn-tape/blob/master/tap-advanced-testing.md)
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "learn-tape",
"version": "2.0.3",
"version": "2.0.4",
"repository": {
"type": "git",
"url": "https://github.com/dwyl/learn-tape.git"
Expand Down
21 changes: 17 additions & 4 deletions tap-advanced-testing.md
@@ -1,4 +1,4 @@
# _Why_ Use `Tap`?
# _Why_ `Tap`?

In _most_ situations **`Tape`** will be _exactly_ what you need
to write and run your Node.js/JavaScript tests. <br />
Expand All @@ -11,7 +11,15 @@ If you find yourself (_your project_) needing to do "setup"
(_e.g. resetting a mock or the state of a front-end app_),
***OR*** you have a few hundred/thousand tests which are taking a "long time"
to run (_e.g: more than 10 seconds_),
then you will benefit form switching to **`Tap`**.
then you will benefit form switching/upgrading to **`Tap`**.


# _What_?

**`Tap`** is testing framework that
has a few _useful_ extra features without being "bloated".

# _How_?



Expand Down Expand Up @@ -51,6 +59,9 @@ then you will benefit form switching to **`Tap`**.
## Analogy: _Single_ Speed vs. _Geared_ Bicycle


To the _untrained_ observer,


<div align="center">
<a href="https://user-images.githubusercontent.com/194400/46041154-102cb800-c10a-11e8-8646-153a77b53408.jpg"> <!-- link to larger version of image -->
<img width="700px" src="https://user-images.githubusercontent.com/194400/47200839-8a4e0680-d36f-11e8-9419-96e8c0ca968e.jpg"
Expand Down Expand Up @@ -94,6 +105,8 @@ in which case we recommend a bit of background reading:
https://bicycles.stackexchange.com/questions/1983/why-ride-a-single-speed-bike
</small>

<br />

# _Why_ NOT Use `Tap` _Everywhere_?

One of the _benefits_ of Free/Open Source software
Expand Down Expand Up @@ -122,5 +135,5 @@ or simply where test runs take longer than 10 seconds
and running them in ***parallel*** significantly reduces waiting time.

For an _extended_ practical example of where writing tests with **`Tap`**
instead of **`Tape`** was worth the switch,
see:
_instead_ of **`Tape`** was worth the switch,
see: https://github.com/dwyl/todomvc-vanilla-javascript-elm-architecture-example

0 comments on commit eca0a8c

Please sign in to comment.