mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-05 13:43:16 +08:00
@@ -1,5 +1,6 @@
|
||||
import {ExitCode} from '@actions/exit'
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
import * as core from '../src/core'
|
||||
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
@@ -11,6 +12,7 @@ const testEnvVars = {
|
||||
'my secret': '',
|
||||
'special char secret \r\n];': '',
|
||||
'my secret2': '',
|
||||
PATH: `path1${path.delimiter}path2`,
|
||||
|
||||
// Set inputs
|
||||
INPUT_MY_INPUT: 'val',
|
||||
@@ -78,6 +80,14 @@ describe('@actions/core', () => {
|
||||
])
|
||||
})
|
||||
|
||||
it('prependPath produces the correct commands and sets the env', () => {
|
||||
core.addPath('myPath')
|
||||
expect(process.env['PATH']).toBe(
|
||||
`myPath${path.delimiter}path1${path.delimiter}path2`
|
||||
)
|
||||
assertWriteCalls([`##[add-path]myPath${os.EOL}`])
|
||||
})
|
||||
|
||||
it('getInput gets non-required input', () => {
|
||||
expect(core.getInput('my input')).toBe('val')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user