Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
[![CircleCI](https://circleci.com/gh/reg-viz/reg-suit.svg?style=svg)](https://circleci.com/gh/reg-viz/reg-suit) [![npm version](https://badge.fury.io/js/reg-suit.svg)](https://badge.fury.io/js/reg-suit) [![License: MIT](https://img.shields.io/badge/Licens
reg-suit is a command line interface for visual regression testing.
$ npm install -g reg-suit
$ cd path-to-your-project
$ reg-suit init
# Answer a few questions...
$ reg-suit run
reg-suit has it's own plugin system. Plugins integrate your project with various services.
The following plugins are available:
For example, installing keygen-git-hash and publish-s3 plugins, you can get regression testing workflow according with GitHub flow as shown in the figure below.
reg-suit [options] <command>
run
commandRun visual testing, publish the current snapshot images, and send notifications. It's equivalent to reg-suit sync-expected && reg-suit compare && reg-suit publish -n
.
sync-expected
commandFetch images published already as the expected snapshot data into working directory. The expected key is detected with the installed key-generator plugin, and installed publisher-plugin
fetches images data.
compare
commandCompare images in the actualDir
with images fetched at sync-expected
and create an HTML report.
publish
commandPublish the compare
result and actual images to external storage with publisher-plugin with the actual snapshot key generated by installed key-generator plugin.
-n
, --notification
: Send notification using installed notifier plugins.init
commandInstall and configure reg-suit and plugins into your project.
--use-yarn
: By the default cli installs packages using npm
. If you prefer yarn pkg, turn this option on.prepare
commandConfigure the installed plugin(s). It's useful to configure reg-suit and plugins.
-p
, --plugin
: Specify plugin name(s) to be configured.-c
, --config
: Configuration file path.-t
, --test
: Perform a trial with no changes(Dry-run mode).-v
, --verbose
: Display debug logging messages.-q
, --quiet
: Suppress logging messages.If you want more details, please exec reg-suit -h
or reg-suit <command> -h
.
To configure reg-suit, put regconfig.json
under the project root directory. regconfig.json
should be JSON file such as:
{
"core": {
"workingDir": ".reg",
"actualDir": "images",
"threshold": 0.05
},
"plugins": {
"reg-keygen-git-hash-plugin": {},
"reg-publish-s3-plugin": {
"bucketName": "your-aws-s3-bucket"
}
}
}
The core
section contains reg-suit core setting and the plugins
section contains plugin specific options.
core
{
actualDir: string;
workingDir?: string; // default ".reg"
threshold?: number; // default 0
}
actualDir
- Required - A directory which contains image files you want to test.workingDir
- Optional - A directory used by reg-suit puts temporary files. Ordinarily this dir is in listed at .gitignore
.threshold
- Optional - Pixel matching threshold. It should be in ranges from 0
to 1
.plugins
Entries of plugins
section are described as key-value pairs. Each key should be plugin name. If you want configurable value, see README.md under the each plugin package(e.g. packages/reg-publish-s3-plugin/README.md).
reg-suit replaces embedded placeholders in plugins
section to environment values at runtime. For example:
"plugins": {
"reg-publish-s3-plugin": {
"bucketName": "$S3_BUCKET_NAME"
}
}
export S3_BUCKET_NAME="my-bucket"
reg-suit run
# reg-publish-s3-plugin is configured with the following value:
#
# {
# "bucketName": "my-bucket"
# }
A working demonstration is here.
reg-suit(git-hash-plugin) needs the current branch name to identify the base-commit hash. However, under some CI services' environment(e.g. TravisCI, WerckerCI), the HEAD is detached. So you should attach it explicitly.
For example:
# .travis.yml
script:
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" # This line is necessary to disable --single-branch option to fetch all remote branches on TravisCI.
- git fetch origin # Ditto
- git checkout $TRAVIS_BRANCH || git checkout -b $TRAVIS_BRANCH
- reg-suit run
# wercker.yml
build:
steps:
- script:
name: Attach HEAD
code: |
git checkout $WERCKER_GIT_BRANCH || git checkout -b $WERCKER_GIT_BRANCH
- script:
name: Run reg-suit
code: |
reg-suit run
PRs are welcome!
git clone https://github.com/reg-viz/reg-suit.git; cd reg-suit
yarn
yarn run bootstrap
yarn run test
Remarks - reg-publish-s3-plugin
testing access to AWS S3 and it needs AWS credentials.
MIT. See LICENSE.txt.
FAQs
![reg-suit](./images/reg-suit.jpg)
The npm package reg-suit receives a total of 45,706 weekly downloads. As such, reg-suit popularity was classified as popular.
We found that reg-suit 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.