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

lazytest

v0.2.10

Published

A project from matriks2 seed

Downloads

36

Readme

#lazy tests framework 一个更好、更方便的测试框架。 #前言 优化测试代码的流程、减少前端代码的测试成本,实现了一个简单的 "业务先行" 的快速本地测试框架, 利用peek和后期手动指定test预期结果的方法, 快速管理所有前端测试. ##目录

1.1 安装lazy-test
1.2 在项目中初始化lazy-test
1.3 运行示例测试并查看结果
1.4 在项目中加入测试入口页面
1.5 开始编写测试
    1. 其他配置
    1. lazy-tests framework开发详细文档

##1. 快速入门 更详细的使用文档,可以点击这里 lazy-test测试框架使用文档

###1.1 安装与启动

全局安装命令行

npm install -g lazytest

因此可以在shell中执行这两个命令:

lazy-init:初始化

lazy-test:启动测试服务

###1.2 初始化

在项目根目录执行命令

lazy-init

这个命令会在你的 project 根目录下生成一个 lazy-tests/ 文件夹

lazy-tests/
├── example-test-page.js					#
├── local-config.js							# lazy-test框架配置文件
├── reports									# 存放测试结果的目录
│   └── report_2017-05-21_21-53-54			#测试结果子目录
│       ├── sample-test-suite-1.json		# 根据suite划分的测试数据
│       └── sample-test-suite-2.json
└── tests									# 你编写的的test将放置在这个目录下
    ├── sample-test-suite-1					# 测试suite目录
    │   ├── expects.json
    │   └── index.js						# 编写的测试入口文件
    └── sample-test-suite-2
        ├── data
        │   ├── hello.js
        │   └── world.js
        ├── expects.json
        └── index.js

###1.3 运行示例测试并查看结果

在项目根目录下执行命令

lazy-test

shell提示服务启动成功后,访问http://localhost:5555/即可访问lazy-tests测试控制台

在这个页面,你可以

  1. 启动一个新的测试
  2. 查看测试结果报告
  3. 快速修改peeks的预期结果
  4. 查看peek & expect构成的文档

尝试体验测试控制台的所有功能吧

###1.4 在项目中加入测试入口页面

###1.5 编写测试

请参考自动生成的sample-test,lazy-test可以进行以下测试:

  • 接口测试
  • mobx测试
  • 页面测试

更多功能,由你发掘。

最后,开始编写你的测试吧

##2.其他配置 查看/lazy-test/local-config.js文件

var localConfig = {
    // 请重新指定本页面到正确的项目测试入口页
    lazyTestPage: '/pages/lazy-test.html',
    // 如果 lazy-tests 在其他的位置, 请指定
    lazyTestReports: path.resolve(root + '/lazy-tests/reports'),
    lazyTestSuites: path.resolve(root + '/lazy-tests/tests'),
    // 如果使用其他 port, 请指定
    port: 5555,
};

##3.lazy-test开发文档

lazy-test测试框架开发文档

包含接口设计说明、开发过程以及后续开发计划的详细文档