fix tests

This commit is contained in:
ArjixWasTaken
2025-12-30 22:01:53 +02:00
parent 2b15f0a87c
commit 6c881a265a
6 changed files with 89 additions and 56 deletions

View File

@ -18,51 +18,89 @@ export default tsEslint.config(
{
plugins: {
stylistic,
importPlugin
importPlugin,
},
languageOptions: {
parser: tsEslint.parser,
parserOptions: {
project: true,
project: ['tsconfig.json', 'tsconfig.test.json'],
sourceType: 'module',
ecmaVersion: 'latest'
}
ecmaVersion: 'latest',
},
},
rules: {
'stylistic/arrow-parens': ['error', 'always'],
'stylistic/object-curly-spacing': ['error', 'always'],
'stylistic/jsx-pascal-case': 'error',
'stylistic/jsx-curly-spacing': ['error', { when: 'never', children: true }],
'stylistic/jsx-curly-spacing': [
'error',
{ when: 'never', children: true },
],
'stylistic/jsx-sort-props': 'error',
'prettier/prettier': ['error', { singleQuote: true, semi: true, tabWidth: 2, trailingComma: 'all', quoteProps: 'preserve' }],
'prettier/prettier': [
'error',
{
singleQuote: true,
semi: true,
tabWidth: 2,
trailingComma: 'all',
quoteProps: 'preserve',
},
],
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': ['off', { checksVoidReturn: false }],
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-misused-promises': [
'off',
{ checksVoidReturn: false },
],
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/consistent-type-imports': ['error', {
fixStyle: 'inline-type-imports',
prefer: 'type-imports',
disallowTypeAnnotations: false,
}],
'@typescript-eslint/consistent-type-imports': [
'error',
{
fixStyle: 'inline-type-imports',
prefer: 'type-imports',
disallowTypeAnnotations: false,
},
],
'importPlugin/first': 'error',
'importPlugin/newline-after-import': 'off',
'importPlugin/no-default-export': 'off',
'importPlugin/no-duplicates': 'error',
'importPlugin/no-unresolved': ['error', { ignore: ['^virtual:', '\\?inline$', '\\?raw$', '\\?asset&asarUnpack'] }],
'importPlugin/order': ['error', {
'groups': ['builtin', 'external', ['internal', 'index', 'sibling'], 'parent', 'type'],
'newlines-between': 'always-and-inside-groups',
'alphabetize': { order: 'ignore', caseInsensitive: false }
}],
'importPlugin/no-unresolved': [
'error',
{
ignore: ['^virtual:', '\\?inline$', '\\?raw$', '\\?asset&asarUnpack'],
},
],
'importPlugin/order': [
'error',
{
'groups': [
'builtin',
'external',
['internal', 'index', 'sibling'],
'parent',
'type',
],
'newlines-between': 'always-and-inside-groups',
'alphabetize': { order: 'ignore', caseInsensitive: false },
},
],
'importPlugin/prefer-default-export': 'off',
'camelcase': ['error', { properties: 'never' }],
'class-methods-use-this': 'off',
'stylistic/lines-around-comment': ['error', {
beforeBlockComment: false,
afterBlockComment: false,
beforeLineComment: false,
afterLineComment: false,
}],
'stylistic/lines-around-comment': [
'error',
{
beforeBlockComment: false,
afterBlockComment: false,
beforeLineComment: false,
afterLineComment: false,
},
],
'stylistic/max-len': 'off',
'stylistic/no-mixed-operators': 'warn', // prettier does not support no-mixed-operators
'stylistic/no-multi-spaces': ['error', { ignoreEOLComments: true }],
@ -70,16 +108,20 @@ export default tsEslint.config(
'no-void': 'error',
'no-empty': 'off',
'prefer-promise-reject-errors': 'off',
'stylistic/quotes': ['error', 'single', {
avoidEscape: true,
allowTemplateLiterals: 'never',
}],
'stylistic/quotes': [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: 'never',
},
],
'stylistic/quote-props': ['error', 'consistent'],
'stylistic/semi': ['error', 'always'],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts']
'@typescript-eslint/parser': ['.ts'],
},
'import/resolver': {
typescript: {},

View File

@ -168,7 +168,6 @@
"eslint-plugin-solid": "0.14.5",
"glob": "11.1.0",
"node-gyp": "11.4.2",
"playwright": "1.55.1",
"ts-morph": "27.0.2",
"typescript": "5.9.3",
"typescript-eslint": "8.43.0",

21
pnpm-lock.yaml generated
View File

@ -343,9 +343,6 @@ importers:
node-gyp:
specifier: 11.4.2
version: 11.4.2
playwright:
specifier: 1.55.1
version: 1.55.1
ts-morph:
specifier: 27.0.2
version: 27.0.2
@ -3902,21 +3899,11 @@ packages:
engines: {node: '>=18'}
hasBin: true
playwright-core@1.55.1:
resolution: {integrity: sha512-Z6Mh9mkwX+zxSlHqdr5AOcJnfp+xUWLCt9uKV18fhzA8eyxUd8NUWzAjxUh55RZKSYwDGX0cfaySdhZJGMoJ+w==}
engines: {node: '>=18'}
hasBin: true
playwright@1.55.0:
resolution: {integrity: sha512-sdCWStblvV1YU909Xqx0DhOjPZE4/5lJsIS84IfN9dAZfcl/CIZ5O8l3o0j7hPMjDvqoTF8ZUcc+i/GL5erstA==}
engines: {node: '>=18'}
hasBin: true
playwright@1.55.1:
resolution: {integrity: sha512-cJW4Xd/G3v5ovXtJJ52MAOclqeac9S/aGGgRzLabuF8TnIb6xHvMzKIa6JmrRzUkeXJgfL1MhukP0NK6l39h3A==}
engines: {node: '>=18'}
hasBin: true
plist@3.1.0:
resolution: {integrity: sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==}
engines: {node: '>=10.4.0'}
@ -8933,20 +8920,12 @@ snapshots:
playwright-core@1.55.0: {}
playwright-core@1.55.1: {}
playwright@1.55.0:
dependencies:
playwright-core: 1.55.0
optionalDependencies:
fsevents: 2.3.2
playwright@1.55.1:
dependencies:
playwright-core: 1.55.1
optionalDependencies:
fsevents: 2.3.2
plist@3.1.0:
dependencies:
'@xmldom/xmldom': 0.8.11

View File

@ -1,7 +1,7 @@
import path from 'node:path';
import process from 'node:process';
import { _electron as electron } from 'playwright';
import { test, expect } from '@playwright/test';
import { test, expect, _electron as electron } from '@playwright/test';
process.env.NODE_ENV = 'test';
@ -32,7 +32,11 @@ test('Pear Desktop App - With default settings, app is launched and visible', as
// expect(title.replaceAll(/\s/g, ' ')).toEqual('Pear Desktop');
const url = window.url();
expect(url.startsWith('https://music.\u0079\u006f\u0075\u0074\u0075\u0062\u0065.com')).toBe(true);
expect(
url.startsWith(
'https://music.\u0079\u006f\u0075\u0074\u0075\u0062\u0065.com',
),
).toBe(true);
await app.close();
});

View File

@ -25,7 +25,8 @@
"exclude": ["./dist"],
"include": [
"electron.vite.config.mts",
"playwright.config.ts",
"./src/**/*",
"*.config.*js",
"*.config.*js"
]
}

8
tsconfig.test.json Normal file
View File

@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"exclude": ["./dist"],
"include": [
"playwright.config.ts",
"./tests/**/*"
]
}