Add core.isDebug() to check whether actions_step_debug is on or not. (#278)

This commit is contained in:
Tingluo Huang authored and GitHub committed 2020-03-02 07:45:27 -05:00
1 parent 2fdecbeb4c
commit 5c16b2f4fa
3 files changed
+26

No files matched your search

+13
View File
@@ -177,6 +177,19 @@ describe('@actions/core', () => {
it('getState gets wrapper action state', () => {
expect(core.getState('TEST_1')).toBe('state_val')
})
it('isDebug check debug state', () => {
const current = process.env['RUNNER_DEBUG']
try {
delete process.env.RUNNER_DEBUG
expect(core.isDebug()).toBe(false)
process.env['RUNNER_DEBUG'] = '1'
expect(core.isDebug()).toBe(true)
} finally {
process.env['RUNNER_DEBUG'] = current
}
})
})
// Assert that process.stdout.write calls called only with the given arguments.