Giter Site home page Giter Site logo

mocha-demos's Introduction

This repo is for my article "A Mocha tutorial of Examples" (in Chinese).

"Mocha is a feature-rich JavaScript test framework running on Node.js and the browser, making asynchronous testing simple and fun."

-- Mochajs.org

How to use

First, clone the repo.

$ git clone https://github.com/ruanyf/mocha-demos.git

Then, install the dependencies locally and Mocha globally.

$ cd mocha-demos
$ npm install
$ npm install --global mocha

Enter the demo01 subdirectory.

$ mocha add.test.js

Now, play with the other examples under the repo's demo* directories.

Index

License

MIT

mocha-demos's People

Contributors

birdca avatar ruanyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mocha-demos's Issues

promise单元测试

老师你好,
我跑脚本promise.test.js,结果是
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves

Use of chai, confusing

I thought mocha was a total independent test framework.
So why using chai in addition?

mocha es6转码问题

老师你好,
我的测试脚本是es6,需要进行转码,根据您的教程中的步骤,
到使用--compilers参数指定测试脚本的转码器。这一步时,出现了一个错误。
image
这是我的babelrc:
image
这是我的依赖
image
请问我哪里操作错了啊?

demo03

执行递归测试脚本时最后执行结果错误输出,单独测试的话是没有这个错误输出的,麻烦可以告诉一下是什么问题吗?
image

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.