Code Monkey home page Code Monkey logo

Comments (10)

LingzhiLiu avatar LingzhiLiu commented on June 21, 2024

mocha和karma有啥区别,是一起搭配使用吗?

from 2019.03.

chenwenqin avatar chenwenqin commented on June 21, 2024

1.测试是每个方法都需要写测试用例吗?
2.有的方法不可测,比如,没有返回值的方法,或者一些功能性的方法,如何进行测试?

from 2019.03.

LingzhiLiu avatar LingzhiLiu commented on June 21, 2024

1.在react中,测试react组件时,往往会用到enzyme库中mount来渲染组件,测到当前父组件和子组件的交互,或者和原生dom元素的交互,这种测试还算单元测试吗?
2. TDD一定是先写测试再写代码吗? 平时写完代码再写单元测试,这是什么模式? 应用e2e端到端测试是BDD模式吗?

from 2019.03.

sunmorg avatar sunmorg commented on June 21, 2024

本来这个问题提在第二课问题里面了,就想更深入的学习一下多态!希望老师可以讲解一下

from 2019.03.

FANZHETWO avatar FANZHETWO commented on June 21, 2024

针对业务场景的方法是否有必要写单元测试?如果可以,怎么更好的面对变化的业务需求编写灵活的测试用例。

from 2019.03.

pan463859 avatar pan463859 commented on June 21, 2024

测试工具结合React或者Vue这样的框架要怎么使用呢?

from 2019.03.

viviScript avatar viviScript commented on June 21, 2024

在《你不知道的JavaScript》一书中写到:使用prototype去实现面向对象的方式是对JavaScript的一种误解与错误使用。es6中推出class的写法也只是实现的一种语法糖,并不是真正理解JavaScript的一种方式。
在书中,作者推荐我们使用对象关联的**去理解prototype机制,以面向委托的设计思路去使用prototype。在自己使用这种思路去实现demo后发现,理解方式很新颖,思路也较为清晰,以对象与对象之间的关系去理解prototype貌似更容易接受。
想请问老师:在JavaScript未来的发展中,这种面向委托,对象关联的设计是否是前端的正确方向,是否会普及使用,毕竟个人理解面向对象确实不适用JavaScript这种动态类型语言。

from 2019.03.

jsong93 avatar jsong93 commented on June 21, 2024

老师 可以演示一下测试的调试过程吗,mocha和karma怎么调试,打断点

from 2019.03.

jsong93 avatar jsong93 commented on June 21, 2024

mocha为什么不是从上到下按顺序执行,练习4 为什么43行先报错,第8行后报错

from 2019.03.

YvongYang avatar YvongYang commented on June 21, 2024

老师,同上问mocha执行的时候可以在terminal里输出值么?
例如:

it('global', function () {
    function test() {
      console.log(this)   // 就是测试的时候类似这种但是是在命令行中输出
    }
    test()
  })

from 2019.03.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.