Skip to content

Commit

Permalink
Merge pull request #22 from hugo-vrijswijk/feat/refactor-ts
Browse files Browse the repository at this point in the history
feat: refactor to TypeScript
  • Loading branch information
TimonVS committed Oct 26, 2019
2 parents d5a9ff1 + f8295a8 commit 83baf10
Show file tree
Hide file tree
Showing 10 changed files with 914 additions and 1,000 deletions.
10 changes: 5 additions & 5 deletions __tests__/action.test.js → __tests__/action.test.ts
@@ -1,6 +1,6 @@
const nock = require('nock')
const fs = require('fs')
const action = require('../src/action')
import nock from 'nock'
import fs from 'fs'
import action from '../src/action'

nock.disableNetConnect()

Expand Down Expand Up @@ -74,7 +74,7 @@ describe('pr-labeler-action', () => {
})
})

function encodeContent(content) {
function encodeContent(content: Buffer) {
return Buffer.from(content).toString('base64')
}

Expand All @@ -99,7 +99,7 @@ function configFixture(fileName = 'config.yml') {
}
}

function pullRequestOpenedFixture({ ref }) {
function pullRequestOpenedFixture({ ref }: { ref: string }) {
return {
pull_request: {
number: 1,
Expand Down
4 changes: 4 additions & 0 deletions jest.config.js
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};

0 comments on commit 83baf10

Please sign in to comment.