зеркало из https://github.com/electron/trop.git
chore: move tests to top-level dir (#117)
This commit is contained in:
Родитель
ed52afee8a
Коммит
bd8b84efd3
|
@ -2,13 +2,13 @@ process.env.SPEC_RUNNING = '1';
|
|||
|
||||
module.exports = {
|
||||
roots: [
|
||||
'<rootDir>/src'
|
||||
'<rootDir>/spec'
|
||||
],
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest'
|
||||
},
|
||||
clearMocks: true,
|
||||
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
|
||||
testRegex: '(/spec/.*|(\\.|/)(test|spec))\\.tsx?$',
|
||||
moduleFileExtensions: [
|
||||
'ts',
|
||||
'tsx',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as commands from '../../constants';
|
||||
import * as commands from '../src/constants';
|
||||
|
||||
describe('commands', () => {
|
||||
it('should all be unique', () => {
|
|
@ -1,12 +1,12 @@
|
|||
jest.mock('request');
|
||||
import { Application } from 'probot';
|
||||
|
||||
import * as utils from '../utils';
|
||||
import { backportToBranch, backportToLabel } from '../../operations/backport-to-location';
|
||||
import { updateManualBackport } from '../../operations/update-manual-backport';
|
||||
import { ProbotHandler } from '../../index';
|
||||
import * as utils from '../src/utils';
|
||||
import { backportToBranch, backportToLabel } from '../src/operations/backport-to-location';
|
||||
import { updateManualBackport } from '../src/operations/update-manual-backport';
|
||||
import { ProbotHandler } from '../src/index';
|
||||
|
||||
const trop: ProbotHandler = require('../../index');
|
||||
const trop: ProbotHandler = require('../src/index');
|
||||
|
||||
// event fixtures
|
||||
const prClosedEvent = require('./fixtures/pull_request.closed.json');
|
||||
|
@ -17,8 +17,11 @@ const issueCommentBackportCreatedEvent = require('./fixtures/issue_comment_backp
|
|||
const issueCommentBackportToCreatedEvent = require('./fixtures/issue_comment_backport_to.created.json');
|
||||
const issueCommentBackportToMultipleCreatedEvent = require('./fixtures/issue_comment_backport_to_multiple.created.json');
|
||||
|
||||
jest.mock('../../operations/update-manual-backport', () => ({ updateManualBackport: jest.fn() }));
|
||||
jest.mock('../../operations/backport-to-location', () => ({
|
||||
jest.mock('../src/operations/update-manual-backport', () => ({
|
||||
updateManualBackport: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.mock('../src/operations/backport-to-location', () => ({
|
||||
backportToBranch: jest.fn(),
|
||||
backportToLabel: jest.fn(),
|
||||
}));
|
|
@ -3,8 +3,8 @@ import * as fs from 'fs-extra';
|
|||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as simpleGit from 'simple-git/promise';
|
||||
import { initRepo } from '../../operations/init-repo';
|
||||
import { setupRemotes } from '../../operations/setup-remotes';
|
||||
import { initRepo } from '../src/operations/init-repo';
|
||||
import { setupRemotes } from '../src/operations/setup-remotes';
|
||||
|
||||
let dirObject: { dir?: string } | null = null;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { EventEmitter } from 'events';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
import { ExecutionQueue } from '../Queue';
|
||||
import { ExecutionQueue } from '../src/Queue';
|
||||
|
||||
const noop = async () => {};
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { Application, Context } from 'probot';
|
||||
|
||||
import { backportImpl, labelMergedPR } from './backport/utils';
|
||||
import { backportImpl, labelMergedPR } from './utils';
|
||||
import { labelToTargetBranch } from './utils/label-utils';
|
||||
import { PullRequest, TropConfig } from './Probot';
|
||||
import { CHECK_PREFIX } from './constants';
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Application, Context } from 'probot';
|
|||
import { Label } from '../Probot';
|
||||
import { PRStatus, BackportPurpose } from '../enums';
|
||||
import * as labelUtils from '../utils/label-utils';
|
||||
import { backportImpl } from '../backport/utils';
|
||||
import { backportImpl } from '../utils';
|
||||
|
||||
/*
|
||||
* Performs a backport to a specified label.
|
||||
|
|
|
@ -5,16 +5,16 @@ import * as fs from 'fs-extra';
|
|||
import { IQueue } from 'queue';
|
||||
import * as simpleGit from 'simple-git/promise';
|
||||
|
||||
import { PullRequest } from '../Probot';
|
||||
import { PullRequest } from './Probot';
|
||||
import queue from './Queue';
|
||||
import { CHECK_PREFIX } from '../constants';
|
||||
import { PRStatus, BackportPurpose } from '../enums';
|
||||
import { CHECK_PREFIX } from './constants';
|
||||
import { PRStatus, BackportPurpose } from './enums';
|
||||
|
||||
import * as labelUtils from '../utils/label-utils';
|
||||
import { initRepo } from '../operations/init-repo';
|
||||
import { setupRemotes } from '../operations/setup-remotes';
|
||||
import { backportCommitsToBranch } from '../operations/backport-commits';
|
||||
import { getRepoToken } from '../utils/token-util';
|
||||
import * as labelUtils from './utils/label-utils';
|
||||
import { initRepo } from './operations/init-repo';
|
||||
import { setupRemotes } from './operations/setup-remotes';
|
||||
import { backportCommitsToBranch } from './operations/backport-commits';
|
||||
import { getRepoToken } from './utils/token-util';
|
||||
|
||||
const makeQueue: IQueue = require('queue');
|
||||
const { parse: parseDiff } = require('what-the-diff');
|
Загрузка…
Ссылка в новой задаче