tl;dr
- write a failing test from the outside in
- make it pass
- refactor towards good design
- take a break and repeat
TODO why?
version: '3.7' | |
services: | |
minio: | |
image: minio/minio:RELEASE.2019-10-12T01-39-57Z | |
volumes: | |
- minio-data:/data | |
ports: | |
- "9000:9000" | |
environment: |
node_modules | |
yarn.lock |
node_modules | |
import React from 'react'; | |
import {render} from "react-testing-library"; | |
const Hello = ({names}) => <div> | |
{names.map((name, index) => <p key={index}>{name}</p>)} | |
</div>; | |
it('<Hello /> displays names in order', () => { | |
const {getByText} = render( | |
<Hello names={[ |
If you are using JUnit 4, don’t forget to also add @RunWith(SpringRunner.class) to your test, otherwise the annotations will be ignored.
acceptance test
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
mockmvc acceptance test
➜ /tmp curl -sL git.io/fhr4u | bash -s 2.1.1.RELEASE | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 51161 100 51106 100 55 149k 164 --:--:-- --:--:-- --:--:-- 149k | |
Archive: web-app.zip | |
inflating: web-app/mvnw | |
creating: web-app/.mvn/ | |
creating: web-app/.mvn/wrapper/ | |
creating: web-app/src/ | |
creating: web-app/src/main/ |
.idea |
Sun Jul 15 13:45:16 UTC 2018 |