Skip to content

Commit 0c57458

Browse files
committed
test: fix env
1 parent 803fd35 commit 0c57458

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

__tests__/index.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ import path from 'path'
33
import dotenv from 'dotenv'
44
import { getInput } from '../src/input'
55

6+
beforeAll(() => {
7+
dotenv.config()
8+
})
9+
610
test('input', () => {
7-
process.env.INPUT_TOKEN = 'token'
811
process.env.INPUT_GIST_ID = 'gist_id'
912
process.env.INPUT_GIST_DESCRIPTION = 'gist_description'
1013
process.env.INPUT_GIST_FILE_NAME = 'gist_file_name'
1114
process.env.INPUT_FILE_PATH = 'file_path'
1215

1316
const input = getInput()
1417

15-
expect(input.token).toMatch('token')
18+
expect(input.token).toBeTruthy()
1619
expect(input.gistId).toMatch('gist_id')
1720
expect(input.gistDescription).toMatch('gist_description')
1821
expect(input.gistFileName).toMatch('gist_file_name')
@@ -21,8 +24,6 @@ test('input', () => {
2124

2225
test('run', () => {
2326
process.env.GITHUB_WORKSPACE = process.cwd()
24-
delete process.env.INPUT_TOKEN
25-
dotenv.config()
2627
process.env.INPUT_GIST_ID = 'e885afa349a0e5d1cfb408e46d6a37bc'
2728
process.env.INPUT_GIST_DESCRIPTION = 'foo bar'
2829
process.env.INPUT_GIST_FILE_NAME = 'foo.bar'

0 commit comments

Comments
 (0)