@chadfawcett/probot-serverless-now
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -12,3 +12,4 @@ const { createProbot } = require('probot') | ||
module.exports.serverless = (apps, options = defaultOptions) => { | ||
module.exports.serverless = (apps, options) => { | ||
options = { ...defaultOptions, ...options } | ||
const probot = createProbot(options) | ||
@@ -15,0 +16,0 @@ apps = [].concat(apps) // Coerce to array |
const nock = require('nock') | ||
const request = require('supertest') | ||
const { createProbot } = require('probot') | ||
const { serverless } = require('./') | ||
jest.mock('probot/lib/private-key', () => ({ | ||
findPrivateKey: () => 'privatekey' | ||
})) | ||
jest.mock('probot', () => ({ | ||
createProbot: jest.fn(jest.requireActual('probot').createProbot) | ||
})) | ||
nock.disableNetConnect() | ||
@@ -17,2 +25,6 @@ nock.enableNetConnect('127.0.0.1') | ||
beforeEach(() => { | ||
createProbot.mockClear() | ||
}) | ||
test('exports regular NodeJS listener usable by servers', () => { | ||
@@ -37,1 +49,9 @@ const [route, app] = createApp('app1') | ||
}) | ||
test('should only override provided defaults', () => { | ||
const id = 1 | ||
serverless(() => {}, { id }) | ||
const options = createProbot.mock.calls[0][0] | ||
expect(options.id).toBe(id) | ||
expect(options.cert).toBe('privatekey') | ||
}) |
{ | ||
"name": "@chadfawcett/probot-serverless-now", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A Probot extension to make it easier to run your Probot Apps on Zeit Now v2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
[![npm Version](https://badgen.net/npm/v/@chadfawcett/probot-serverless-now)](https://npmjs.com/package/@chadfawcett/probot-serverless-now) | ||
[![npm Version](https://img.shields.io/npm/v/@chadfawcett/probot-serverless-now.svg)](https://npmjs.com/package/@chadfawcett/probot-serverless-now) | ||
[![Build Status](https://semaphoreci.com/api/v1/chadfawcett/probot-serverless-now/branches/master/shields_badge.svg)](https://semaphoreci.com/chadfawcett/probot-serverless-now) | ||
@@ -3,0 +3,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9026
66