Skip to content

Commit

Permalink
test: add tests for event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
viestat authored Oct 8, 2019
1 parent fd7b1c5 commit 2a2fa30
Show file tree
Hide file tree
Showing 55 changed files with 554 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@

dist
9 changes: 9 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ env:
es6: true
node: true
extends: '@ridedott/eslint-config'
overrides:
- env:
jest: true
files:
- src/**/*.spec.ts
rules:
'@typescript-eslint/no-magic-numbers': off
eslint(max-lines-per-function): off
no-magic-numbers: off
parserOptions:
ecmaVersion: 10
project: tsconfig.json
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ coverage

# Include distribution files, as Actions are directly clonned and run.
!dist/*

# TypeScript Build output
lib
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
coverage
dist
package.json
package-lock.json
82 changes: 82 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"configurations": [
{
"args": ["${relativeFile}"],
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "neverOpen",
"name": "run:ts",
"protocol": "inspector",
"request": "launch",
"runtimeArgs": ["-r", "ts-node/register"],
"type": "node"
},
{
"args": ["--runInBand"],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"disableOptimisticBPs": true,
"internalConsoleOptions": "neverOpen",
"name": "test",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"request": "launch",
"type": "node",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"args": ["--runInBand", "--watch"],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"disableOptimisticBPs": true,
"internalConsoleOptions": "neverOpen",
"name": "test:watch",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"request": "launch",
"type": "node",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"args": ["--runInBand", "${relativeFile}"],
"console": "integratedTerminal",
"disableOptimisticBPs": true,
"internalConsoleOptions": "neverOpen",
"name": "test:current",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"request": "launch",
"type": "node",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"args": ["--runInBand", "--watch", "${relativeFile}"],
"console": "integratedTerminal",
"disableOptimisticBPs": true,
"internalConsoleOptions": "neverOpen",
"name": "test:current:watch",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"request": "launch",
"type": "node",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
},
{
"args": ["--coverage", "--runInBand", "--watch", "${relativeFile}"],
"console": "integratedTerminal",
"disableOptimisticBPs": true,
"internalConsoleOptions": "neverOpen",
"name": "test:current:watch:coverage",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"request": "launch",
"type": "node",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
}
],
"version": "0.2.0"
}
1 change: 1 addition & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"*.yaml",
"**/*.json",
"generated/**",
"dist/**",
"lib/**",
"node_modules/**"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/constants.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions dist/eventHandlers/checkSuite.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/eventHandlers/checkSuite.d.ts.map

This file was deleted.

3 changes: 3 additions & 0 deletions dist/eventHandlers/checkSuite/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { GitHub } from '@actions/github';
export declare const checkSuiteHandle: (octokit: GitHub) => Promise<void>;
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/eventHandlers/checkSuite/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/eventHandlers/checkSuite/index.spec.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=index.spec.d.ts.map
1 change: 1 addition & 0 deletions dist/eventHandlers/checkSuite/index.spec.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions dist/eventHandlers/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Event Handler Exports
*/
export * from './checkSuite';
export * from './push';
export * from './pullRequest';
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/eventHandlers/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions dist/eventHandlers/pullRequest.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/eventHandlers/pullRequest.d.ts.map

This file was deleted.

3 changes: 3 additions & 0 deletions dist/eventHandlers/pullRequest/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { GitHub } from '@actions/github';
export declare const pullRequestHandle: (octokit: GitHub) => Promise<void>;
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/eventHandlers/pullRequest/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/eventHandlers/pullRequest/index.spec.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=index.spec.d.ts.map
1 change: 1 addition & 0 deletions dist/eventHandlers/pullRequest/index.spec.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions dist/eventHandlers/push.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/eventHandlers/push.d.ts.map

This file was deleted.

3 changes: 3 additions & 0 deletions dist/eventHandlers/push/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { GitHub } from '@actions/github';
export declare const pushHandle: (octokit: GitHub) => Promise<void>;
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/eventHandlers/push/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/eventHandlers/push/index.spec.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=index.spec.d.ts.map
1 change: 1 addition & 0 deletions dist/eventHandlers/push/index.spec.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/graphql/mutations.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/graphql/queries.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/index.js.cache
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/index.js.cache.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/merge.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/merge.d.ts.map

This file was deleted.

2 changes: 0 additions & 2 deletions dist/octokit.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/octokit.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/queries.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/queries.d.ts.map

This file was deleted.

3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
},
},
preset: 'ts-jest',
resetMocks: true,
roots: ['<rootDir>/src'],
testEnvironment: 'node',
testEnvironment: '<rootDir>/test/TestEnv.js',
};
79 changes: 79 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2a2fa30

Please sign in to comment.