Giter Site home page Giter Site logo

avalon.test's Introduction

avalon.test

专门用于放置avalon的单元测试

第一步,安装node.js相关包

打开一个控制台

输入npm install -g totoro

输入npm install -g totoro-server

输入totoro-server

这时会看到

info 2014-03-03 14:03:58 index.js:66 | Start server <192.168.114.27:9999>

的字样,后面是IP地址与端口号

第二步,配置要测试的浏览器

打开你的firefox27 输入地址 http://192.168.114.27:9999/

打开你的IE10 输入地址 http://192.168.114.27:9999/

打开你的chrome33 输入地址 http://192.168.114.27:9999/

如果你有更多要测试的浏览器,也请继续打开它们。注意你要设法让它们能弹窗

firefox 工具--> 选项 -->内容--> 阻止弹出窗口 -->例外 --> 填入IP(192.168.114.27)

chrome 设置-->在展开的区域中找到 隐私设置 --> 内容设置 -->弹出式窗口--> 管理例外情况--> 填入IP(192.168.114.27)

IE Internet选项--> 隐私 -->启用窗口阻止程序。如果没有勾上就作罢,否则点设置,添加要允许的网站地址(http://192.168.114.27:9999/)

打开另一个控制台

输入 totoro config --host=192.168.114.27 --port=9999

再输入 totoro list

这时就会看到

Desktop: chrome 33.0.1750.117 / windows 7 [1] firefox 27.0 / windows 7 [1] ie 10.0 / windows 7 [1] ……

说明配置成功

第三步,运行测试文件

git clone [email protected]:RubyLouvre/avalon.test.git
cd avalon.test
totoro

会依次弹出三个窗口(或更多),成功会输出如下内容:

在src中拥有两个库,分别是mocha, expect,大家可以到它们的官网看介绍.

至于如何编写测试,请看以下链接

Javascript单元测试工具“抹茶”——Mocha 和 Chai

初识 mocha in NodeJS

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.