From ecd9a32a56eb1cee8c4fe327fd20f355ef8a8b29 Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Fri, 19 Apr 2019 15:15:34 -0400 Subject: [PATCH] Add working Jest & TypeScript config - Jest now uses ts-jest for transforms - TypeScript compilation via `lerna run tsc` --- __tests__/github.test.js | 9 --------- __tests__/github.test.ts | 7 +++++++ lib/github.js | 7 ------- package.json | 3 ++- src/github.ts | 3 +++ tsconfig.json | 11 +++++++++++ 6 files changed, 23 insertions(+), 17 deletions(-) delete mode 100644 __tests__/github.test.js create mode 100644 __tests__/github.test.ts delete mode 100644 lib/github.js create mode 100644 src/github.ts create mode 100644 tsconfig.json diff --git a/__tests__/github.test.js b/__tests__/github.test.js deleted file mode 100644 index a585396..0000000 --- a/__tests__/github.test.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -// const github = require('..'); - -describe('@actions/github', () => { - it('needs tests', () => { - - }); -}); diff --git a/__tests__/github.test.ts b/__tests__/github.test.ts new file mode 100644 index 0000000..3a99860 --- /dev/null +++ b/__tests__/github.test.ts @@ -0,0 +1,7 @@ +import { github } from '../src/github'; + +describe('@actions/github', () => { + it('needs tests', () => { + expect(github()).toBe(true) + }); +}); \ No newline at end of file diff --git a/lib/github.js b/lib/github.js deleted file mode 100644 index 262b98a..0000000 --- a/lib/github.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -module.exports = github; - -function github() { - // TODO -} diff --git a/package.json b/package.json index c2dd0c9..af096ee 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "url": "git+https://github.com/actions/toolkit.git" }, "scripts": { - "test": "echo \"Error: run tests from root\" && exit 1" + "test": "echo \"Error: run tests from root\" && exit 1", + "tsc": "tsc" }, "bugs": { "url": "https://github.com/actions/toolkit/issues" diff --git a/src/github.ts b/src/github.ts new file mode 100644 index 0000000..a34eacd --- /dev/null +++ b/src/github.ts @@ -0,0 +1,3 @@ +export function github() { + return true +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..a8b812a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": "./", + "outDir": "./lib", + "rootDir": "./src" + }, + "include": [ + "./src" + ] +} \ No newline at end of file