Skip to content

Commit

Permalink
Added test and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Apr 23, 2022
1 parent 4ff379d commit e3fa9c4
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,16 @@
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: npm install
- run: npm test
- run: npm run coverage
- uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .npmignore
@@ -1,5 +1,7 @@
.*
minified
test*
coverage
Gruntfile.js
test*
*.html
!test
18 changes: 12 additions & 6 deletions package.json
Expand Up @@ -3,6 +3,10 @@
"version": "1.2.9",
"description": "Tiny Web-Audio GM synth",
"main": "javascript/JZZ.synth.Tiny.js",
"scripts": {
"test": "nyc mocha test/mocha.js",
"coverage": "nyc report --reporter=lcov"
},
"keywords": [
"midi",
"midi-synth",
Expand All @@ -15,15 +19,17 @@
],
"author": "jazz-soft (https://jazz-soft.net/)",
"dependencies": {
"jzz": "^1.4.9"
"jzz": "^1.5.0"
},
"devDependencies": {
"grunt": "^1.4.1",
"grunt": "^1.5.2",
"grunt-contrib-jshint": "^3.2.0",
"grunt-contrib-uglify": "^5.1.0",
"jzz-gui-player": "^1.5.7",
"jzz-midi-gm": "^1.2.8",
"jzz-midi-smf": "^1.6.7"
"grunt-contrib-uglify": "^5.2.1",
"jzz-gui-player": "^1.5.8",
"jzz-midi-gm": "^1.2.9",
"jzz-midi-smf": "^1.6.8",
"mocha": "^9.2.2",
"nyc": "^15.1.0"
},
"runkitExampleFilename": "runkit.js",
"repository": {
Expand Down
14 changes: 14 additions & 0 deletions test/mocha.js
@@ -0,0 +1,14 @@
const assert = require('assert');
const JZZ = require('jzz');
const version = require('../package.json').version;
require('..')(JZZ);

describe('register', function() {
it('register', function() {
JZZ.synth.Tiny.register();
JZZ.synth.Tiny.register('synth');
});
it('version', function() {
assert.equal(JZZ.synth.Tiny.version(), version);
});
});

0 comments on commit e3fa9c4

Please sign in to comment.