Skip to content

Commit

Permalink
Add actions for testing & linting (#3)
Browse files Browse the repository at this point in the history
* Add actions for testing & linting

* Add changelog entry

* Two-space indentation is nicer for yaml

* Add jest coverage reporting
  • Loading branch information
MattIPv4 authored Mar 21, 2022
1 parent 17c4e76 commit 13fe5ef
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
[{*.json,*.yml}]
indent_size = 2
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on: [ push, pull_request ]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Lint package
run: npm run lint

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Test package
run: npm test
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Each list item should be prefixed with `(patch)` or `(minor)` or `(major)`.
See `PUBLISH.md` for instructions on how to publish a new version.
-->

- (patch) Add Actions workflows to repo for linting/testing


## v1.0.1 - 599e553

Expand Down
18 changes: 18 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'@(modifiers|rules|util)/**/*.js',
'index.js',
],
// TODO: Improve test coverage and enable coverage thresholds (ideally at 100%)
// coverageThreshold: {
// global: {
// branches: 80,
// functions: 80,
// lines: 80,
// statements: 80,
// },
// },
};

0 comments on commit 13fe5ef

Please sign in to comment.