Giter VIP home page Giter VIP logo

blog's People

Watchers

 avatar  avatar

blog's Issues

关于 Karma 的一些问题整理

为什么需要 files 来控制文件的加载呢?

是这个的好处就是如果遇到一些大的项目, 如果每次测试的时候都加载所有的文件, 那么就会极大的降低测试速度, 而 karma 的一个设计理念就是快, 还有就是持续. 所以就需要一种手段可以让我们进行局部测试, 也就是说我们一般开发的都是局部的代码, 那么我们就可以在这个阶段设置一下我们修改的文件, 保证我们可以快速的得到测试结果. 只有在开发一个阶段后, 我们再可以整体进行测试.

还有一个原因就是 karma 支持文件的监控, 当文件发生变化的时候, 自动执行测试. 只有这样 Karma 才可以有效的进行监控.

The core idea is to get a continuous feedback from tests, with minimal dis- traction to the developer.

karma 的设计理念

  • 速度
    首先可以快速的得到测试结果.
  • 可靠
    就是说测试和代码的错误, 不能影响服务本身的可靠性, 需要一个稳定的服务.
  • 在真实的浏览器测试
    这样才能准确的反应出代码本身的正确性.
  • 无缝的工作流
    尽量不干扰开发过程.

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.