Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refactor to TypeScript #22

Merged
merged 1 commit into from Oct 26, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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',
};