1- import * as cp from 'child_process'
2- import * as path from 'path'
1+ import { execSync } from 'child_process'
2+ import path from 'path'
33import dotenv from 'dotenv'
4- import { getInputs } from '../src/inputs'
4+ import { getInput } from '../src/inputs'
55
66test ( '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 '
7+ process . env . INPUT_GIST_ID = 'gist_id '
8+ process . env . INPUT_GIST_FILE_NAME = 'gist_file_name '
9+ process . env . INPUT_FILE_PATH = 'file_path '
1010
11- const inp = getInputs ( )
11+ const input = getInput ( )
1212
13- expect ( inp . Token ) . 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 ' )
13+ expect ( input . Token ) . toMatch ( '' )
14+ expect ( input . GistID ) . toMatch ( 'gist_id ' )
15+ expect ( input . GistFileName ) . toMatch ( 'gist_file_name ' )
16+ expect ( input . FilePath ) . toMatch ( 'file_path ' )
1717} )
1818
1919test ( 'run' , ( ) => {
@@ -23,6 +23,6 @@ test('run', () => {
2323 process . env . INPUT_GIST_FILE_NAME = 'foo.bar'
2424 process . env . INPUT_FILE_PATH = '__tests__/foo.bar'
2525
26- const ip = path . join ( __dirname , '..' , 'lib' , 'index.js' )
27- cp . execSync ( `node ${ ip } ` , { env : process . env } )
26+ const filePath = path . join ( __dirname , '..' , 'lib' , 'index.js' )
27+ execSync ( `node ${ filePath } ` , { env : process . env } )
2828} )
0 commit comments