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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@devecorsoft/miniprogram-visual-test

v1.2.1

Published

a visual test tool for wechat miniprogram custom components

Readme

miniprogram-visual-test

A visual regression testing tool for WeChat Mini Programs, inspired by cypress-plugin-visual-regression-diff. It helps you automate UI screenshot comparisons to catch visual changes and regressions in your miniprogram projects. Supports both Jest and Vitest.


Features

  • Automated screenshot capture for miniprogram custom components
  • Pixel-by-pixel image diffing with threshold configuration
  • Integrates with Vitest and Jest
  • Forwards wx.request to anywhere you want
  • Easy to extend and customize

Installation

Install with npm:

npm install @devecorsoft/miniprogram-visual-test miniprogram-automator --save-dev

Or with yarn:

yarn add -D @devecorsoft/miniprogram-visual-test miniprogram-automator

Note that please make sure you have wechat miniprogram devtool installed.

Usage

Get started with Jest

  1. Enable matcher in jest.config.js:
// jest.config.js
module.exports = {
  // ...existing config
  setupFilesAfterEnv: [
    // ...other setup files
    '@devecorsoft/miniprogram-visual-test/jest-matcher',
  ],
};
  1. load test component and match screenshots
import { launchDevTool, loadTestComponent } from "../src/devTool/launcher.ts";
import type MiniProgram from "miniprogram-automator/out/MiniProgram";
import * as path from "path";

describe('screenshot', () => {
  let miniProgram: MiniProgram

  afterEach(() => miniProgram.close())

  it('should able to take screenshot for first running', async () => {
    const testProjectPath = path.resolve('.')
    loadTestComponent(
      path.resolve('test/test-component-js/test-component'),
      testProjectPath,
      {
        template: '<test-component title="visual" count="12"/>',
        includes: ['miniprogram_npm', 'styles', 'commonDeps']
      }
    )
    const devTool = await launchDevTool(appId, {forwardRequestTo: 'http://localhost:8080/path'})
    miniProgram = devTool.miniProgram
    
    const view = await devTool.page.$("view")
    await expect(view!.text()).resolves.toBe('js component')
    
    await expect(miniProgram).toMatchScreenshot({maxDiffThreshold: 0})
  })
})

Note that: see tests for all the usages.

Maintaining Stable Visual Testing

  1. Use a fixed color profile by following these steps in DevTools: Settings → Open Chrome flags settings → Force color profile → sRGB.
  2. Use monitors with similar physical resolutions. Although you can manually set the device's DPR (device pixel ratio) to 1 in the emulator, high-resolution monitors may still cause screenshots to double in size, making image comparisons less accurate.

Contributing

Contributions are welcome! Please open issues or pull requests for bug fixes, features, or documentation improvements.

License

This project is licensed under the MIT License.