Skip to content

Commit

Permalink
Merge branch 'github-action-tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwhitman committed Feb 4, 2022
2 parents f68187d + ffd626d commit ebdc39e
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 6 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/run-tests.yml
@@ -0,0 +1,31 @@
name: Run tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 17.x]

steps:
- name: Git checkout
uses: actions/checkout@v1

- name: npm ci
run: |
npm ci
- name: npm run-script lint
run: |
npm run-script lint
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: npm run-script test
run: |
npm run-script test
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -5,7 +5,8 @@
"main": "./lib/pushbullet.js",
"type": "module",
"scripts": {
"lint": "./node_modules/.bin/eslint ."
"lint": "./node_modules/.bin/eslint .",
"test": "./node_modules/.bin/mocha"
},
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions test/chats.js
@@ -1,3 +1,5 @@
/* global describe,it */

import nock from 'nock';
import PushBullet from '../lib/pushbullet.js';
import { should } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions test/devices.js
@@ -1,3 +1,5 @@
/* global describe,it */

import nock from 'nock';
import PushBullet from '../lib/pushbullet.js';
import { should } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions test/ephemerals.js
@@ -1,3 +1,5 @@
/* global describe,it */

import nock from 'nock';
import PushBullet from '../lib/pushbullet.js';
import { should } from 'chai';
Expand Down
12 changes: 7 additions & 5 deletions test/pushes.js
@@ -1,3 +1,5 @@
/* global describe,it */

import { fileURLToPath } from 'url';
import nock from 'nock';
import PushBullet from '../lib/pushbullet.js';
Expand Down Expand Up @@ -62,11 +64,11 @@ describe('PushBullet.file()', () => {
upload_url : 'https://upload.pushbullet.com/upload-legacy/some-hash'
});

nock('https://upload.pushbullet.com', {
reqheaders : {
'Content-Type' : headerValue => headerValue.startsWith('multipart/form-data; boundary')
}
})
const uploadHeaders = {
'Content-Type' : headerValue => headerValue.startsWith('multipart/form-data; boundary')
};

nock('https://upload.pushbullet.com', { reqheaders : uploadHeaders })
.post('/upload-legacy/some-hash', /.*Content-Disposition: form-data;.*/gi)
.reply(204);

Expand Down
2 changes: 2 additions & 0 deletions test/subscriptions.js
@@ -1,3 +1,5 @@
/* global describe,it */

import nock from 'nock';
import PushBullet from '../lib/pushbullet.js';
import { should } from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions test/users.js
@@ -1,3 +1,5 @@
/* global describe,it */

import nock from 'nock';
import PushBullet from '../lib/pushbullet.js';
import { should } from 'chai';
Expand Down

0 comments on commit ebdc39e

Please sign in to comment.