npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

totoro-test

v0.1.5

Published

A simple, easy-to-use and stable front-end unit testing tool.

Downloads

7

Readme

totoro-test

支付宝前端测试方案

totoro-test 是一个可以把模块中的测试用例,发送到不同的浏览器上执行,并收集相应的测试结果的一个程序.

目前我们所有的测试都是针对 cmd 模块

安装

npm install totoro -g

安装完成后

totoro --verson

能够现实出正确的信息,说明已经安装成功,目前最新的版本是 0.0.6

使用

主要有两种使用方式

标准方式

直接进入模块的目录执行下面命令即可.

totoro test

使用演示

下面是一个真实的例子,大家可以按照下面的步骤来体会整个执行流程

  • 检出模块代码
git clone https://github.com/aralejs/base.git
  • 进入到 base 目录中,执行
totoro test
  • 然后就会看到下面类似的结果
Firefox 19.0.0 (Windows 7) PASSED 20 tests
IE 7.0.0 (Windows XP) PASSED 20 tests
IE 8.0.0 (Windows 7) PASSED 20 tests
Chrome 25.0.1364 (Windows 7) PASSED 20 tests
IE 9.0.0 (Windows 7) PASSED 20 tests
IE 6.0.0 (Windows XP) PASSED 20 tests
Opera 12.14.0 (Windows XP) PASSED 20 tests
Safari 5.1.7 (Windows 7) PASSED 20 tests
PASSED on all browsers

看到上面的内容就说明你已经会使用 totoro 了,是不是很简单。

注意事项(v0.0.6)

  1. 只支持标准的 cmd 模块,具体的模块样本可以参考 arale 相关模块
  2. 只支持 mocha 测试套件。其中如果使用到 expect 需要在测试用例中 require('expect)
  3. 目前模块中单元测试用例需要在 testtests 目录中
  4. 目前测试用例 totoro 只能识别 *-spec.js*-test.js 这两种形式的测试文件.

指定测试页

如果我们的模块已经有了一个可以运行的测试页,我我们可以通过下面的命令 totoro 就会自动把你的测试页面在指定的刘浏览器中运行,并返回测试结果.

totoro test -r _site/tests/runner.html

注意事项(v0.0.6)

  1. 我们目前支持下面集中测试套件:
    • mocha
    • jasmine
    • quint
    • yuitest
  2. 在测试页面中对这些测试套件的引用必须显式引用,比如:
    <script src='../mocha.js'></script>

更多文档和介绍详见 wiki