Skip to content

Commit

Permalink
Add testing action (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
drobnikj authored May 24, 2021
1 parent a0acaea commit b5cac86
Show file tree
Hide file tree
Showing 7 changed files with 732 additions and 35 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pr_toolkit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Apify PR toolkit

on:
pull_request:
branches:
- main

jobs:
apify-pr-toolkit:
runs-on: ubuntu-20.04
steps:
- name: clone local repository
uses: actions/checkout@v2

- name: run PR toolkit console team
uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
team-name: Platform
team-members: drobnikj
61 changes: 61 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import {findMilestone} from '../src/main'

test('findMilestone', async () => {
const milestones = [
{
"url": "",
"id": 20,
"number": 20,
"title": "13th Sprint - Platform team",
"description": "",
"open_issues": 9,
"closed_issues": 19,
"state": "open",
"created_at": "2021-05-10T07:53:55Z",
"updated_at": "2021-05-24T12:13:32Z",
"due_on": "2021-05-23T07:00:00Z",
},
{
"url": "",
"id": 19,
"number": 19,
"title": "13th Sprint - Console team",
"description": "",
"open_issues": 29,
"closed_issues": 32,
"state": "open",
"created_at": "2021-05-10T06:56:49Z",
"updated_at": "2021-05-24T11:30:52Z",
"due_on": "2021-05-23T07:00:00Z",
},
{
"url": "",
"id": 21,
"number": 21,
"title": "14th Sprint - Console team",
"description": "",
"open_issues": 31,
"closed_issues": 0,
"state": "open",
"created_at": "2021-05-24T05:29:20Z",
"updated_at": "2021-05-24T13:48:01Z",
"due_on": "2021-06-06T07:00:00Z",
},
{
"url": "",
"id": 22,
"number": 22,
"title": "14th Sprint - Platform team",
"description": "",
"open_issues": 15,
"closed_issues": 0,
"state": "open",
"created_at": "2021-05-24T08:16:56Z",
"updated_at": "2021-05-24T13:20:19Z",
"due_on": "2021-06-06T07:00:00Z",
}
]
const foundMilestone = findMilestone(milestones, 'Platform');
// @ts-ignore
expect(foundMilestone.title).toBe('14th Sprint - Platform team')
})
38 changes: 22 additions & 16 deletions dist/index.js

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

11 changes: 11 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest'
},
verbose: true
}
Loading

0 comments on commit b5cac86

Please sign in to comment.