官术网_书友最值得收藏!

Commit early and often

The second sentence of that command output (You should commit this file) is a good cue for us to commit for the first time.

TDD provides natural breakpoints for you to commit code. If you’re starting out with TDD, I’d recommend committing to source control after every single test. That might seem like overkill for your projects at work, but as you're learning, it can be a very effective tool.

If you've ever watched The Weakest Link, you'll know that contestants can choose to bank their winnings at any time, which decreases their risk of losing money but reduces their earning potential. With git, you can use git add to effectively bank your code. This saves a snapshot of your code but does not commit it. If you make a mess in the next test, you can revert to the last banked state. I tend to do this after every test. And, unlike in The Weakest Link, there's no downside to banking!

Committing early and often simplifies commit messages. If you have just one test in a commit, then you can use the test description as your commit message. No thinking is required.

If you're using git, use the following commands to commit what you’ve done so far:

git init
echo "node_modules" > .gitignore
git add .
git commit -m "Blank project with Jest dependency"
主站蜘蛛池模板: 西丰县| 长葛市| 五莲县| 北川| 织金县| 长丰县| 龙陵县| 浑源县| 襄城县| 同心县| 鄂伦春自治旗| 大姚县| 高雄县| 宜黄县| 修水县| 靖安县| 津市市| 云阳县| 兴仁县| 游戏| 商洛市| 涪陵区| 锡林浩特市| 新巴尔虎右旗| 海林市| 南丹县| 万山特区| 韶关市| 禄丰县| 丹凤县| 广河县| 中西区| 青河县| 临江市| 全南县| 郧西县| 定安县| 蓬溪县| 中西区| 彩票| 邯郸市|