Skip to content
This repository has been archived by the owner on Jan 3, 2020. It is now read-only.

Update dependencies to enable Greenkeeper 🌴 #14

Merged
merged 3 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# linter-alex

[![build status](https://travis-ci.org/swinton/linter-alex.svg?branch=master)](https://travis-ci.org/swinton/linter-alex) [![coverage status](https://coveralls.io/repos/github/swinton/linter-alex/badge.svg?branch=master)](https://coveralls.io/github/swinton/linter-alex?branch=master)
[![build status](https://travis-ci.org/swinton/linter-alex.svg?branch=master)](https://travis-ci.org/swinton/linter-alex) [![coverage status](https://coveralls.io/repos/github/swinton/linter-alex/badge.svg?branch=master)](https://coveralls.io/github/swinton/linter-alex?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/swinton/linter-alex.svg)](https://greenkeeper.io/)

> a GitHub App built with [probot](https://github.com/probot/probot) combining [Alex](http://alexjs.com/) with GitHub's [(beta) Checks API](https://developer.github.com/changes/2018-05-07-new-checks-api-public-beta/) to ensure **sensitive, considerate writing before you merge your Pull Requests**.

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"simulate-run": "LOG_LEVEL=TRACE node_modules/.bin/probot simulate check_run ./test/fixtures/check_run.rerequested.json ./index.js"
},
"dependencies": {
"alex": "^5.1.0",
"probot": "^6.1.0"
"alex": "^6.0.0",
"probot": "^7.1.0"
},
"devDependencies": {
"@octokit/rest": "15.2.0",
"@octokit/rest": "15.11.1",
"coveralls": "^3.0.2",
"jest": "^23.0.0",
"nodemon": "^1.17.4",
"smee-client": "^1.0.1",
"standard": "^10.0.3"
"standard": "^12.0.1"
},
"engines": {
"node": ">= 8.3.0"
Expand Down
36 changes: 18 additions & 18 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const {createRobot} = require('probot')
const app = require('..')
const { Application } = require('probot')
const myProbotApp = require('..')
const checkSuitePayload = require('./fixtures/check_suite.requested')
const checkRunPayload = require('./fixtures/check_run.rerequested')
const myDate = new Date(Date.UTC(2018, 0, 1))
Expand All @@ -11,8 +11,8 @@ jest.mock('../lib/analysis.js')
const analyzeTree = require('../lib/analysis')

describe('index', () => {
let app
let event
let robot
let github

beforeEach(() => {
Expand All @@ -25,22 +25,22 @@ describe('index', () => {
Object.assign(Date, RealDate)

// Define event
event = {event: 'check_suite', payload: checkSuitePayload}
event = {name: 'check_suite', payload: checkSuitePayload}

// Create robot instance
robot = createRobot()
// Create app instance
app = new Application()

// Initialize app with robot instance
app(robot)
// Initialize app with probot application
app.load(myProbotApp)

// Mock out the GitHub API
github = {}
github.request = jest
.fn()
.mockResolvedValue({data: {id: 42, url: "https://api.github.com/repos/wintron/example/check-runs/42"}})

// Pass mocked out GitHub API into out robot instance
robot.auth = () => Promise.resolve(github)
// Pass mocked out GitHub API into our app instance
app.auth = () => Promise.resolve(github)
})

afterEach(() => {
Expand All @@ -51,7 +51,7 @@ describe('index', () => {
it('handles no annotations', async () => {
analyzeTree.mockResolvedValue([])

await robot.receive(event)
await app.receive(event)

expect(github.request).toHaveBeenCalledTimes(2)
expect(github.request).toHaveBeenNthCalledWith(1, {
Expand Down Expand Up @@ -96,7 +96,7 @@ describe('index', () => {
}]
])

await robot.receive(event)
await app.receive(event)

expect(github.request).toHaveBeenCalledTimes(3)
expect(github.request).toHaveBeenNthCalledWith(1, {
Expand Down Expand Up @@ -165,7 +165,7 @@ describe('index', () => {
}]
])

await robot.receive(event)
await app.receive(event)

expect(github.request).toHaveBeenCalledTimes(3)
expect(github.request).toHaveBeenNthCalledWith(1, {
Expand Down Expand Up @@ -243,7 +243,7 @@ describe('index', () => {
}]
])

await robot.receive(event)
await app.receive(event)

expect(github.request).toHaveBeenCalledTimes(3)
expect(github.request).toHaveBeenNthCalledWith(1, {
Expand Down Expand Up @@ -301,11 +301,11 @@ describe('index', () => {

it('handles a check_run event', async () => {
// Override event
event = {event: 'check_run', payload: checkRunPayload}
event = {name: 'check_run', payload: checkRunPayload}

analyzeTree.mockResolvedValue([])

await robot.receive(event)
await app.receive(event)

expect(github.request).toHaveBeenCalledTimes(2)
expect(github.request).toHaveBeenNthCalledWith(1, {
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('index', () => {

analyzeTree.mockResolvedValue([annotations])

await robot.receive(event)
await app.receive(event)

expect(annotations.length).toBe(100)
expect(github.request).toHaveBeenCalledTimes(4)
Expand Down Expand Up @@ -403,7 +403,7 @@ describe('index', () => {
// Override event action
event.payload.action = 'completed'

await robot.receive(event)
await app.receive(event)

expect(github.request).toHaveBeenCalledTimes(0)
expect(analyzeTree).toHaveBeenCalledTimes(0)
Expand Down