Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot testing #110

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Tests

on: push

jobs:
rspec:
runs-on: ubuntu-latest
name: Tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm test
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
jquery.peity.min.js.gz
/node_modules
/test/comparisons
/test/images
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jquery.peity.js
jquery.peity.min.js
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ clean:
docs: jquery.peity.min.js.gz
bin/update_docs $(VERSION)

fixtures:
rm -f test/fixtures/*
node test/fixtures.js

release: test docs bower.json package.json
@printf '\e[0;32m%-6s\e[m\n' "Happy days, everything passes. Make sure CHANGELOG.md is already up-to-date, commit everything, and tag it:"
@echo ' $$ git commit -m "Version $(VERSION)."'
Expand All @@ -33,8 +29,6 @@ server:
node test/server.js

test:
rm -f test/comparisons/*
rm -f test/images/*
./node_modules/.bin/mocha -R spec -t 30000 $(ARGS) ./test/index.js
npm test

.PHONY: clean fixtures release server test
.PHONY: clean release server test
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Peity

[![Tests](https://github.com/benpickles/peity/actions/workflows/tests.yml/badge.svg)](https://github.com/benpickles/peity/actions/workflows/tests.yml)

Peity (sounds like deity) is a jQuery plugin that converts an element's content into a mini `<svg>` pie, donut, line or bar chart.

## Basic Usage
Expand Down Expand Up @@ -28,13 +30,9 @@ More detailed usage can be found at [benpickles.github.io/peity](http://benpickl

## Development

Run the automated visual regression tests with:

make test

Run a filtered set of tests with:
Run the automated tests with:

ARGS="--grep bar" make test
npm test

To manually view all test cases run:

Expand Down
3 changes: 3 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preset": "jest-puppeteer"
}
Loading
Loading