зеркало из https://github.com/electron/trop.git
Fix dem tests
This commit is contained in:
Родитель
c62da68eb5
Коммит
3d7b142da0
|
@ -1,2 +1,3 @@
|
|||
node_modules
|
||||
lib
|
||||
working
|
|
@ -8,6 +8,7 @@
|
|||
"scripts": {
|
||||
"prestart": "tsc",
|
||||
"start": "probot run ./lib/index.js",
|
||||
"pretest": "tsc",
|
||||
"test": "jest && standard"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
jest.mock('request')
|
||||
jest.mock('../lib/backport/utils.js', () => ({
|
||||
ensureElectronUpToDate: async () => {},
|
||||
backportPR: async () => {}
|
||||
}))
|
||||
const {createRobot} = require('probot')
|
||||
const issueBoardTracker = require('../index.js')
|
||||
const issueBoardTracker = require('../lib/index.js')
|
||||
|
||||
const pushEventPayload = require('./fixtures/push.json')
|
||||
const issueLabeledEventPayload = require('./fixtures/issues.labeled.json')
|
||||
|
@ -9,9 +13,9 @@ const prLabeledEventPayload = require('./fixtures/pull_request.labeled.json')
|
|||
describe('issue-board-tracker', () => {
|
||||
let robot, github
|
||||
|
||||
beforeEach(() => {
|
||||
beforeEach(async () => {
|
||||
robot = createRobot()
|
||||
issueBoardTracker(robot)
|
||||
await issueBoardTracker(robot)
|
||||
|
||||
github = {
|
||||
repos: {
|
||||
|
|
|
@ -6,7 +6,7 @@ import * as simpleGit from 'simple-git';
|
|||
import { Probot, ProbotContext, Label, PullRequestEvent } from './Probot';
|
||||
import queue from './Queue';
|
||||
|
||||
const dir = path.resolve(__dirname, '..', 'working');
|
||||
const dir = path.resolve(__dirname, '..', '..', 'working');
|
||||
const getGit = () => simpleGit(dir);
|
||||
|
||||
export const ensureElectronUpToDate = async () => {
|
||||
|
|
12
src/index.js
12
src/index.js
|
@ -1,7 +1,11 @@
|
|||
import randomColor from 'randomcolor'
|
||||
import * as randomColor from 'randomcolor'
|
||||
import { backportPR, ensureElectronUpToDate } from './backport/utils'
|
||||
|
||||
module.exports = (robot) => {
|
||||
module.exports = async (robot) => {
|
||||
robot.log('initializing working directory')
|
||||
await ensureElectronUpToDate()
|
||||
robot.log('working directory ready')
|
||||
|
||||
// get watched board and create labels based on column names
|
||||
robot.on('push', async context => {
|
||||
const config = await context.config('config.yml')
|
||||
|
@ -70,10 +74,6 @@ module.exports = (robot) => {
|
|||
}
|
||||
})
|
||||
|
||||
robot.log('initializing working directory')
|
||||
await ensureElectronUpToDate()
|
||||
robot.log('working directory ready')
|
||||
|
||||
robot.on('pull_request.closed', context => {
|
||||
const payload = context.payload
|
||||
if (payload.pull_request.merged) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"target": "es2018",
|
||||
"outDir": "lib",
|
||||
"lib": [
|
||||
"es6"
|
||||
|
|
Загрузка…
Ссылка в новой задаче