Skip to content

Commit

Permalink
chore: Switch to Github Actions (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell authored Mar 27, 2020
1 parent 40bafed commit 5a5340e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 23 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests
on:
push:
branches: [master]
pull_request:
branches: [master]

env:
CI: true

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node-version: [8, 10, 12, 13]
include:
- os: windows-latest
node-version: 8
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Node.js ${{matrix.node-version}} on ${{matrix.os}}
uses: actions/setup-node@v1
with:
node-version: ${{matrix.node-version}}
- run: npm install
- name: Lint
run: npm run -s pretest -- --reporter stylish
- name: Tests
run: npm run -s tests-only
- name: Coverage
run: npm run -s posttest
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.tgz
.travis.yml
.github
coverage/
.c8rc.json
fixtures/
Expand Down
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"scripts": {
"release": "standard-version --sign",
"pretest": "xo",
"test": "c8 tape test/test.js"
"tests-only": "c8 --no-check-coverage -r none tape test/test.js | tap-min",
"test": "npm run -s tests-only",
"posttest": "if-ver -ge 10 || exit 0; c8 report"
},
"engines": {
"node": ">=8"
Expand All @@ -30,7 +32,9 @@
},
"devDependencies": {
"c8": "^7.0.0",
"if-ver": "^1.1.0",
"standard-version": "^7.0.0",
"tap-min": "^2.0.0",
"tape": "^4.11.0",
"xo": "^0.25.3"
}
Expand Down
8 changes: 7 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ test('basic tests', async t => {
}

function checkResults(expectedSets, expectedAppends, expectedDump, dumped) {
t.deepEqual(dumped, expectedDump);
// Windows variables oddly injected
const actual = {...dumped};
for (const id of ['SYSTEMDRIVE', 'SYSTEMROOT', 'WINDIR']) {
delete actual[id];
}

t.deepEqual(actual, expectedDump);
t.is(setValueCalled, expectedSets);
setValueCalled = 0;
t.is(appendValueCalled, expectedAppends);
Expand Down

0 comments on commit 5a5340e

Please sign in to comment.