Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

release: v1.2.2 #68

Merged
merged 9 commits into from
Mar 21, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.idea
/.vscode
/node_modules
/coverage
/lib
Expand Down
8 changes: 4 additions & 4 deletions __tests__/process.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
testEnv,
spyOnStdout,
stdoutCalledWith,
spyOnExec,
spyOnSpawn,
testChildProcess,
setChildProcessParams,
execCalledWith,
Expand Down Expand Up @@ -159,7 +159,7 @@ describe('execute', () => {
process.env.GITHUB_WORKSPACE = '/home/runner/work/my-repo-name/my-repo-name';
process.env.INPUT_GITHUB_TOKEN = 'test token';

const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
const mockStdout = spyOnStdout();
setChildProcessParams({
stdout: (command: string): string => {
Expand Down Expand Up @@ -262,7 +262,7 @@ describe('execute', () => {
it('should execute empty', async() => {
process.env.GITHUB_WORKSPACE = '/home/runner/work/my-repo-name/my-repo-name';

const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
const mockStdout = spyOnStdout();

await execute(logger, prContext, []);
Expand Down Expand Up @@ -294,7 +294,7 @@ describe('execute', () => {
it('should not execute if not cloned', async() => {
process.env.GITHUB_WORKSPACE = '/home/runner/work/my-repo-name/my-repo-name';

const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
const mockStdout = spyOnStdout();
setChildProcessParams({
stdout: (command: string): string => {
Expand Down
24 changes: 12 additions & 12 deletions __tests__/utils/command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path, { resolve } from 'path';
import {
generateContext,
testEnv,
spyOnExec,
spyOnSpawn,
testChildProcess,
execCalledWith,
setChildProcessParams,
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('getGitDiff', () => {
process.env.GITHUB_WORKSPACE = '/home/runner/work/my-repo-name/my-repo-name';
process.env.INPUT_GITHUB_TOKEN = 'test token';

const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: (command: string): string => {
if (command.startsWith('git diff')) {
Expand Down Expand Up @@ -104,7 +104,7 @@ describe('getGitDiff', () => {
process.env.GITHUB_WORKSPACE = '/home/runner/work/my-repo-name/my-repo-name';
process.env.INPUT_GITHUB_TOKEN = 'test token';

const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: (command: string): string => {
if (command.startsWith('git diff')) {
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('getGitDiff', () => {
process.env.GITHUB_WORKSPACE = '/home/runner/work/my-repo-name/my-repo-name';
process.env.INPUT_GITHUB_TOKEN = 'test token';

const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: (command: string): string => {
if (command.startsWith('git diff')) {
Expand Down Expand Up @@ -178,7 +178,7 @@ describe('getGitDiff', () => {
process.env.GITHUB_WORKSPACE = '/home/runner/work/my-repo-name/my-repo-name';
process.env.INPUT_GITHUB_TOKEN = 'test token';

const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: (command: string): string => {
if (command.startsWith('git diff')) {
Expand Down Expand Up @@ -216,7 +216,7 @@ describe('getGitDiff', () => {
process.env.GITHUB_WORKSPACE = '/home/runner/work/my-repo-name/my-repo-name';
process.env.INPUT_GITHUB_TOKEN = 'test token';

const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: (command: string): string => {
if (command.startsWith('git diff')) {
Expand All @@ -236,7 +236,7 @@ describe('getGitDiff', () => {
process.env.GITHUB_WORKSPACE = '/home/runner/work/my-repo-name/my-repo-name';
process.env.INPUT_GITHUB_TOKEN = 'test token';

const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: (command: string): string => {
if (command.startsWith('git diff')) {
Expand Down Expand Up @@ -287,7 +287,7 @@ describe('getGitDiff', () => {
process.env.INPUT_SUFFIX_FILTER = '.ts\n.txt';
process.env.INPUT_ABSOLUTE = 'true';
process.env.INPUT_SET_ENV_NAME = '';
const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: (command: string): string => {
if (command.startsWith('git diff')) {
Expand Down Expand Up @@ -319,7 +319,7 @@ describe('getGitDiff', () => {

describe('getFileDiff', () => {
it('should get file diff 1', async() => {
const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: '1 file changed, 25 insertions(+), 4 deletions(-)',
});
Expand All @@ -336,7 +336,7 @@ describe('getFileDiff', () => {
});

it('should get file diff 2', async() => {
const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: '1 file changed, 1 insertion(+), 3 deletions(-)',
});
Expand All @@ -353,7 +353,7 @@ describe('getFileDiff', () => {
});

it('should get file diff 3', async() => {
const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: '1 file changed, 3 insertions(+)',
});
Expand All @@ -370,7 +370,7 @@ describe('getFileDiff', () => {
});

it('should return empty', async() => {
const mockExec = spyOnExec();
const mockExec = spyOnSpawn();
setChildProcessParams({
stdout: '',
});
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@technote-space/get-diff-action",
"version": "1.2.1",
"version": "1.2.2",
"description": "GitHub actions to get git diff.",
"author": {
"name": "Technote",
Expand All @@ -27,24 +27,24 @@
"dependencies": {
"@actions/core": "^1.2.3",
"@actions/github": "^2.1.1",
"@technote-space/filter-github-action": "^0.2.5",
"@technote-space/github-action-helper": "^1.3.1"
"@technote-space/filter-github-action": "^0.2.6",
"@technote-space/github-action-helper": "^2.0.0"
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@technote-space/github-action-test-helper": "^0.2.6",
"@technote-space/release-github-actions-cli": "^1.5.0",
"@technote-space/github-action-test-helper": "^0.3.1",
"@technote-space/release-github-actions-cli": "^1.5.3",
"@types/jest": "^25.1.4",
"@types/node": "^13.9.0",
"@typescript-eslint/eslint-plugin": "^2.23.0",
"@typescript-eslint/parser": "^2.23.0",
"@types/node": "^13.9.2",
"@typescript-eslint/eslint-plugin": "^2.24.0",
"@typescript-eslint/parser": "^2.24.0",
"eslint": "^6.8.0",
"husky": "^4.2.3",
"jest": "^25.1.0",
"jest-circus": "^25.1.0",
"lint-staged": "^10.0.8",
"nock": "^12.0.2",
"nock": "^12.0.3",
"ts-jest": "^25.2.1",
"typescript": "^3.8.3"
},
Expand Down
Loading