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

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"
主站蜘蛛池模板: 湘潭市| 班玛县| 察雅县| 新河县| 丹寨县| 惠安县| 奎屯市| 诏安县| 靖西县| 南涧| 恭城| 扬州市| 翁源县| 庆阳市| 延长县| 安顺市| 华池县| 庄浪县| 兴义市| 铜鼓县| 镇赉县| 松潘县| 安丘市| 邹城市| 高雄县| 仪陇县| 资阳市| 临漳县| 霍州市| 溧水县| 乐山市| 冷水江市| 安康市| 陇南市| 桃源县| 新干县| 宁海县| 灌云县| 耿马| 锦州市| 西和县|