测试驱动开发(TDD)
  • 介绍
  • 思想实践
    • 开发现状
    • 单元测试与功能测试的区别
    • 7个测试驱动开发的最佳实践
    • 掌握测试驱动开发的技术
    • 白话结语
  • 初步实践
    • 什么时候写测试?
    • Javascript 测试框架
      • Chai
      • Mocha
      • mocha-junit-reporter
      • SuperTest
      • Sinon
      • mockserver
      • Jasmine
      • Qunit
  • 具体实践
    • 收集目前测试问题整理
    • 改变项目开发方式
    • 对微服务Api的实践
Powered by GitBook
On this page
  • 资料
  • 其他参考:

Was this helpful?

  1. 具体实践

对微服务Api的实践

Previous改变项目开发方式

Last updated 5 years ago

Was this helpful?

资料

说明:针对的express框架如何开展tdd的步骤。

  • 指出从如何从功能测试(集成测试),引出单元测试(function函数测试)

  • 示例代码:

说明:使用express的crud操作阐述tdd过程。

  • 同样提到了功能测试(集成测试)和单元测试(function函数测试)

  • 提出了一个很好的解决测试数据的问题,自动生成:

  • 示例代码:

说明:详细使用Red/Green/Refactor的原则的crud操作阐述tdd过程。

  • 字段全校验

  • 示例代码:

其他参考:

 (Lex)

Test-Driven-Development for building APIs in Node.js and Express
https://github.com/cianclarke/tdd-for-apis
Testing Node and Express
faker.js
https://github.com/mjhea0/express-testing-mocha-knex
Test Driven Development with Node, Postgres, and Knex (Red/Green/Refactor)
https://github.com/mjhea0/mocha-chai-knex
BDD/TDD development from scratch with node.js/express
Building Node.js REST API with Express.js, MongoDB & TDD – Tutorial
TDD: Testing NodeJS and React with Mocha, Chai, Sinon and Enzyme
Node Express TDD with RESTful API in Intellij
Test-driven Development of Node.js APIs
Express Routes: A TDD Approach
Using Test-Driven Development for Microservices