
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@devecorsoft/miniprogram-visual-test
Advanced tools
a visual test tool for wechat miniprogram custom components
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.
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.
jest.config.js
:// jest.config.js
module.exports = {
// ...existing config
setupFilesAfterEnv: [
// ...other setup files
'@devecorsoft/miniprogram-visual-test/jest-matcher',
],
};
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.
Contributions are welcome! Please open issues or pull requests for bug fixes, features, or documentation improvements.
This project is licensed under the MIT License.
FAQs
a visual test tool for wechat miniprogram custom components
The npm package @devecorsoft/miniprogram-visual-test receives a total of 159 weekly downloads. As such, @devecorsoft/miniprogram-visual-test popularity was classified as not popular.
We found that @devecorsoft/miniprogram-visual-test demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.