Skip to content

Commit

Permalink
Merge pull request #110 from benpickles/snapshot-testing
Browse files Browse the repository at this point in the history
Snapshot testing
  • Loading branch information
benpickles authored Feb 19, 2024
2 parents aba81b1 + 3cdf419 commit 7428bb4
Show file tree
Hide file tree
Showing 70 changed files with 8,423 additions and 671 deletions.
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

0 comments on commit 7428bb4

Please sign in to comment.