小伍

Behavior Driven Development in ReactJS

如果想跳过前文,可以直接定位到实战篇

What is Test Driven Development?

Coding of features and tests go hand in hand.

  1. Write a unit test.
  2. Run the test. See it fail.
  3. Write the feature code to pass the test.
  4. Refactor the code.

Why TDD?

  • It reduces errors and defects in the long run.
  • It leads to higher quality code.

What is Behavior Driven Development?

  • A variation of TDD that tests for user scenarios.
  • Given, when, then… [ pattern ]
  • Given notes, when deleting, then remove a note.
  • BDD consists of scenarios/specifications.

关于「自由态职业」

最近读了萧秋水和剽悍一只猫的《知识变现》,准确的来说,这本书不全是讲如何变现你的知识,而是从多方面去解释什么是“斜杠青年”和“自由职业”,而“自由态职业”又是什么,个人觉得此书应该改名为《国内斜杠青年/自由工作者的生活/工作现状》。

Blog Log

2018.08.26


2017.04.02

  1. jQuery -> Zepto
  2. fancybox -> magnific popup

以下是相同网络环境下,disable Cache,线上首页用Chrome Network的测试数据:

上线前:
JS,三个请求,jquery.min.js, aio.js, fancybox.js,总计39.8KB
CSS,两个请求,style.css, fancybox.css,总计7KB

上线后:
JS,两个请求,zepto.min.js, aio.js,总计17.9KB
CSS,一个请求,style.css,总计6.5KB

谈谈怎么在不熟悉上下文的情况下debug

跟大家分享一个最近调bug的故事,在不熟悉架构、业务上下文、编程语言、调试环境等等的情况下,遇到问题时,我们可以怎么解决。简单的来说,路过一个你喜欢的站点,发现页面有bug,想帮忙修,怎么办?

Hexo主题的置顶功能

忽然想要一个置顶功能,可惜原生的hexo-generator-index没有提供这样的方法,那只能自己搞一个了~