common base tmpDir for tests

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-02-01 14:29:53 +01:00
parent 257dd09431
commit b193ec6e9e
7 changed files with 25 additions and 12 deletions

View File

@@ -21,7 +21,8 @@ import {describe, expect, jest, it, beforeEach, afterEach} from '@jest/globals';
import {Context} from '../src/context';
const tmpDir = path.join('/tmp/.docker-actions-toolkit-jest').split(path.sep).join(path.posix.sep);
// prettier-ignore
const tmpDir = path.join(process.env.TEMP || '/tmp', 'context-jest').split(path.sep).join(path.posix.sep);
const tmpName = path.join(tmpDir, '.tmpname-jest').split(path.sep).join(path.posix.sep);
jest.spyOn(Context.prototype, 'tmpDir').mockImplementation((): string => {