fix eslint config and lint issues

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-02-01 12:46:43 +01:00
parent ae3911e977
commit c11b80183c
8 changed files with 694 additions and 18 deletions

View File

@@ -17,7 +17,7 @@
import {describe, expect, it, jest, test, beforeEach, afterEach} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';
import rimraf from 'rimraf';
import * as rimraf from 'rimraf';
import * as semver from 'semver';
import {BuildKit} from '../src/buildkit';
@@ -27,13 +27,13 @@ import {Context} from '../src/context';
const tmpDir = path.join('/tmp/.docker-actions-toolkit-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 as any, 'tmpDir').mockImplementation((): string => {
jest.spyOn(Context.prototype, 'tmpDir').mockImplementation((): string => {
if (!fs.existsSync(tmpDir)) {
fs.mkdirSync(tmpDir, {recursive: true});
}
return tmpDir;
});
jest.spyOn(Context.prototype as any, 'tmpName').mockImplementation((): string => {
jest.spyOn(Context.prototype, 'tmpName').mockImplementation((): string => {
return tmpName;
});

View File

@@ -17,7 +17,7 @@
import {describe, expect, it, jest, test, beforeEach, afterEach} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';
import rimraf from 'rimraf';
import * as rimraf from 'rimraf';
import * as semver from 'semver';
import * as exec from '@actions/exec';
@@ -31,13 +31,13 @@ const metadata = `{
"containerimage.digest": "sha256:b09b9482c72371486bb2c1d2c2a2633ed1d0b8389e12c8d52b9e052725c0c83c"
}`;
jest.spyOn(Context.prototype as any, 'tmpDir').mockImplementation((): string => {
jest.spyOn(Context.prototype, 'tmpDir').mockImplementation((): string => {
if (!fs.existsSync(tmpDir)) {
fs.mkdirSync(tmpDir, {recursive: true});
}
return tmpDir;
});
jest.spyOn(Context.prototype as any, 'tmpName').mockImplementation((): string => {
jest.spyOn(Context.prototype, 'tmpName').mockImplementation((): string => {
return tmpName;
});

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
import fs from 'fs';
import path from 'path';
import rimraf from 'rimraf';
import * as fs from 'fs';
import * as path from 'path';
import * as rimraf from 'rimraf';
import {describe, expect, jest, it, beforeEach, afterEach} from '@jest/globals';
import {Context} from '../src/context';