-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
828a192
commit 68d31fe
Showing
33 changed files
with
7,393 additions
and
9,773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,75 @@ | ||
module.exports = { | ||
/** @type {import('eslint').Linter.Config} */ | ||
const config = { | ||
root: true, | ||
'env': { | ||
'node': true | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'unicorn', 'import'], | ||
extends: ['eslint:recommended'], | ||
env: { | ||
node: true, | ||
es6: true, | ||
}, | ||
"parser": "@babel/eslint-parser", | ||
extends: [ | ||
'eslint:recommended' | ||
], | ||
// add your custom rules here | ||
rules: { | ||
'semi': 1, | ||
'no-useless-escape': 0, | ||
'function-paren-newline': 0, | ||
'no-multi-spaces': 0, | ||
'object-curly-newline': 0, | ||
'prefer-destructuring': 0, | ||
'no-param-reassign': 0, | ||
'no-mixed-operators': 0, | ||
'no-unused-vars': 1, | ||
'no-plusplus': 0, | ||
'no-console': 0, | ||
'prefer-template': 0, | ||
'import/no-extraneous-dependencies': 0, | ||
'import/extensions': 0, | ||
'class-methods-use-this': 0, | ||
'consistent-return': 0, | ||
'no-restricted-syntax': 0, | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, | ||
'max-len': ['warn', 140, { 'ignoreComments': true }], | ||
'quote-props': ['error', 'as-needed'], | ||
'comma-dangle': ['error', { | ||
'arrays': 'always-multiline', | ||
'objects': 'always-multiline', | ||
}], | ||
'one-var': ['error', 'never'], | ||
'space-in-parens': ['error', 'never'], | ||
'space-before-blocks': ['error', 'always'], | ||
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }], | ||
'no-var': 2, | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
}, | ||
globals:{ | ||
window: true, | ||
document: true, | ||
jest: true, | ||
describe: true, | ||
fdescribe: true, | ||
xdescribe: true, | ||
|
||
beforeAll: true, | ||
afterAll: true, | ||
|
||
beforeEach: true, | ||
afterEach: true, | ||
|
||
it: true, | ||
fit: true, | ||
xit: true, | ||
|
||
expect: true, | ||
spyOn: true, | ||
rules: { | ||
quotes: ['error', 'single', { avoidEscape: true }], | ||
camelcase: ['error', { properties: 'never' }], | ||
semi: ['error', 'never'], | ||
indent: [2, 4], | ||
eqeqeq: ['error', 'always'], | ||
|
||
$: true, | ||
browser: true, | ||
Promise: true, | ||
Atomics: true, | ||
Int32Array: true, | ||
SharedArrayBuffer: true, | ||
} | ||
'prefer-const': 'error', | ||
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }], | ||
'array-bracket-spacing': ['error', 'never'], | ||
'brace-style': ['error', '1tbs', { allowSingleLine: true }], | ||
'comma-spacing': ['error', { before: false, after: true }], | ||
'no-lonely-if': 'error', | ||
'dot-notation': 'error', | ||
'no-else-return': 'error', | ||
'no-tabs': 'error', | ||
'no-trailing-spaces': [ | ||
'error', | ||
{ | ||
skipBlankLines: false, | ||
ignoreComments: false, | ||
}, | ||
], | ||
'no-var': 'error', | ||
'unicode-bom': ['error', 'never'], | ||
curly: ['error', 'all'], | ||
'object-curly-spacing': ['error', 'always'], | ||
'keyword-spacing': ['error'], | ||
'require-atomic-updates': 0, | ||
'linebreak-style': ['error', 'unix'], | ||
'unicorn/prefer-node-protocol': ['error'], | ||
'import/extensions': ['error', 'ignorePackages'], | ||
'no-restricted-syntax': [ | ||
'error', | ||
'IfStatement > ExpressionStatement > AssignmentExpression', | ||
], | ||
'unicorn/prefer-ternary': 'error', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts'], | ||
rules: { | ||
// see https://stackoverflow.com/questions/55280555/typescript-eslint-eslint-plugin-error-route-is-defined-but-never-used-no-un | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'error', | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
'no-undef': 'off', | ||
// allow overloads | ||
'no-redeclare': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.test.ts'], | ||
rules: { | ||
'dot-notation': 'off', | ||
}, | ||
}, | ||
], | ||
} | ||
|
||
module.exports = config |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
path: 'ffmpeg' | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { vi } from 'vitest' | ||
|
||
export const allureMocks = { | ||
addAttachment: vi.fn(), | ||
addArgument: vi.fn() | ||
} | ||
|
||
export default { | ||
addAttachment(...args: []) { allureMocks.addAttachment(...args) }, | ||
addArgument(...args: []) { allureMocks.addArgument(...args) } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
export let writeMock; | ||
import { vi } from 'vitest' | ||
|
||
export let writeMock: Function | ||
|
||
export const resetWriteMock = () => { | ||
writeMock = jest.fn(); | ||
writeMock = vi.fn(); | ||
}; | ||
|
||
resetWriteMock(); | ||
|
||
export default class Reporter { | ||
constructor(options) { | ||
optionsSetInConstructor: any; | ||
constructor(options: any) { | ||
this.optionsSetInConstructor = options; | ||
} | ||
|
||
write(msg) { | ||
write(msg: any) { | ||
writeMock(msg); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { vi } from 'vitest' | ||
|
||
export const cpMocks = { | ||
spawn: vi.fn().mockReturnValue({ on: vi.fn() }), | ||
}; | ||
|
||
export const spawn = (...args: any[]) => { return cpMocks.spawn(...args); }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default 'file-mock' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { vi } from 'vitest' | ||
export let fsMocks: any | ||
|
||
export const resetFsMocks = () => { | ||
fsMocks = { | ||
copy: vi.fn(), | ||
copySync: vi.fn(), | ||
removeSync: vi.fn(), | ||
writeFile: vi.fn(), | ||
existsSync: vi.fn().mockReturnValue('MOCK'), | ||
mkdirsSync: vi.fn(), | ||
readFileSync: vi.fn() | ||
.mockReturnValueOnce('outputDir/MOCK-VIDEO-1.webm') | ||
.mockReturnValueOnce('outputDir/MOCK-VIDEO-1.webm') | ||
.mockReturnValueOnce('outputDir/MOCK-VIDEO-1.webm') | ||
.mockReturnValueOnce('outputDir/MOCK-VIDEO-2.webm') | ||
.mockReturnValueOnce('outputDir/MOCK-VIDEO-2.webm') | ||
.mockReturnValueOnce('outputDir/MOCK-VIDEO-2.webm'), | ||
readdirSync: vi.fn().mockReturnValue(['MOCK-ALLURE-1.webm', 'MOCK-ALLURE-2.webm']), | ||
statSync: vi.fn().mockReturnValue(({ size: 128 })), | ||
}; | ||
}; | ||
|
||
resetFsMocks(); | ||
|
||
export default { | ||
copy(...args: any[]) { fsMocks.copy(...args); }, | ||
copySync(...args: any[]) { fsMocks.copySync(...args); }, | ||
removeSync(...args: any[]) { fsMocks.removeSync(...args); }, | ||
existsSync(...args: any[]) { return fsMocks.existsSync(...args); }, | ||
mkdirsSync(...args: any[]) { fsMocks.mkdirsSync(...args); }, | ||
readFileSync(...args: any[]) { return fsMocks.readFileSync(...args); }, | ||
readdirSync(...args: any[]) { return fsMocks.readdirSync(...args); }, | ||
statSync(...args: any[]) { return fsMocks.statSync(...args); }, | ||
writeFile(...args: any[]) { return fsMocks.writeFile(...args); }, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { vi } from 'vitest' | ||
|
||
export let globMocks: { glob: Function }; | ||
|
||
export const resetGlobMocks = () => { | ||
globMocks = { | ||
glob: vi.fn((_, cb) => cb(null, [])), | ||
} | ||
} | ||
|
||
resetGlobMocks(); | ||
|
||
export default (...args: any[]) => globMocks.glob(...args); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { vi } from 'vitest' | ||
|
||
export default { | ||
sync: vi.fn() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
export default { | ||
resolve(...args) { | ||
resolve(...args: any[]) { | ||
return args | ||
.slice(1) | ||
.reduce((acc, cur) => acc + '/' + cur, arguments[0]).replace(/\/\//g, '/'); | ||
}, | ||
dirname(file) { | ||
dirname(file: string) { | ||
return file.replace(/[^\/]+?$/, ''); | ||
}, | ||
}; |
Oops, something went wrong.