Skip to content

Commit 1408825

Browse files
committed
test: Initial commit
1 parent 96eb2a6 commit 1408825

File tree

3 files changed

+29
-27
lines changed

3 files changed

+29
-27
lines changed

__tests__/foo.bar

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lorem ipsum

__tests__/index.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import * as cp from 'child_process'
2+
import * as path from 'path'
3+
import dotenv from 'dotenv'
4+
import { getInputs } from '../src/inputs'
5+
6+
test('input', () => {
7+
process.env['INPUT_GIST_ID'] = 'test_gist_id'
8+
process.env['INPUT_GIST_FILE_NAME'] = 'test_gist_file_name'
9+
process.env['INPUT_FILE_PATH'] = 'test_file_path'
10+
11+
const inp = getInputs()
12+
13+
expect(inp.GithubToken).toMatch('')
14+
expect(inp.GistID).toMatch('test_gist_id')
15+
expect(inp.GistFileName).toMatch('test_gist_file_name')
16+
expect(inp.FilePath).toMatch('test_file_path')
17+
})
18+
19+
test('run', () => {
20+
dotenv.config()
21+
process.env['GITHUB_WORKSPACE'] = process.cwd()
22+
process.env['INPUT_GIST_ID'] = 'e885afa349a0e5d1cfb408e46d6a37bc'
23+
process.env['INPUT_GIST_FILE_NAME'] = 'foo.bar'
24+
process.env['INPUT_FILE_PATH'] = '__tests__/foo.bar'
25+
26+
const ip = path.join(__dirname, '..', 'lib', 'index.js')
27+
cp.execSync(`node ${ip}`, { env: process.env })
28+
})

__tests__/main.test.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)