Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .eslintrc.json

This file was deleted.

18 changes: 0 additions & 18 deletions apps/api-e2e/.eslintrc.json

This file was deleted.

12 changes: 12 additions & 0 deletions apps/api-e2e/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import baseConfig from '../../eslint.config.mjs';

export default [
...baseConfig,
{
ignores: ['!**/*'],
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {},
},
];
33 changes: 16 additions & 17 deletions apps/api-e2e/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/* eslint-disable */
export default {
displayName: 'api-e2e',
preset: '../../jest.preset.js',
globalSetup: '<rootDir>/src/support/global-setup.ts',
globalTeardown: '<rootDir>/src/support/global-teardown.ts',
setupFiles: ['<rootDir>/src/support/test-setup.ts'],
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/api-e2e',
displayName: 'api-e2e',
preset: '../../jest.preset.js',
globalSetup: '<rootDir>/src/support/global-setup.ts',
globalTeardown: '<rootDir>/src/support/global-teardown.ts',
setupFiles: ['<rootDir>/src/support/test-setup.ts'],
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/api-e2e',
};
8 changes: 3 additions & 5 deletions apps/api-e2e/src/support/global-teardown.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* eslint-disable */

module.exports = async function () {
// Put clean up logic here (e.g. stopping services, docker-compose, etc.).
// Hint: `globalThis` is shared between setup and teardown.
console.log(globalThis.__TEARDOWN_MESSAGE__);
// Put clean up logic here (e.g. stopping services, docker-compose, etc.).
// Hint: `globalThis` is shared between setup and teardown.
console.log(globalThis.__TEARDOWN_MESSAGE__);
};
10 changes: 4 additions & 6 deletions apps/api-e2e/src/support/test-setup.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* eslint-disable */

import axios from 'axios';

module.exports = async function () {
// Configure axios for tests to use.
const host = process.env.HOST ?? 'localhost';
const port = process.env.PORT ?? '3000';
axios.defaults.baseURL = `http://${host}:${port}`;
// Configure axios for tests to use.
const host = process.env.HOST ?? 'localhost';
const port = process.env.PORT ?? '3000';
axios.defaults.baseURL = `http://${host}:${port}`;
};
15 changes: 2 additions & 13 deletions apps/api/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
import baseConfig from '../../eslint.config.mjs';

export default [
...compat.extends('../../.eslintrc.json'),
...baseConfig,
{
ignores: ['!**/*', '**/generated/*'],
},
Expand Down
22 changes: 0 additions & 22 deletions apps/ui-e2e/.eslintrc.json

This file was deleted.

20 changes: 20 additions & 0 deletions apps/ui-e2e/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import playwrightPlugin from 'eslint-plugin-playwright';
import baseConfig from '../../eslint.config.mjs';

export default [
...baseConfig,
{
ignores: ['!**/*'],
},
{
plugins: {
playwright: playwrightPlugin,
},
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'playwright/no-wait-for-timeout': 'warn',
},
},
];
36 changes: 0 additions & 36 deletions apps/ui/.eslintrc.json

This file was deleted.

45 changes: 45 additions & 0 deletions apps/ui/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import angularPlugin from '@angular-eslint/eslint-plugin';
import angularTemplatePlugin from '@angular-eslint/eslint-plugin-template';
import templateParser from '@angular-eslint/template-parser';
import baseConfig from '../../eslint.config.mjs';

export default [
...baseConfig,
{
ignores: ['!**/*'],
},
{
plugins: {
'@angular-eslint': angularPlugin,
'@angular-eslint/template': angularTemplatePlugin,
},
},
{
files: ['**/*.ts'],
rules: {
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'gh',
style: 'camelCase',
},
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'gh',
style: 'kebab-case',
},
],
},
},
{
files: ['**/*.html'],
languageOptions: {
parser: templateParser,
},
rules: {},
},
];
17 changes: 4 additions & 13 deletions apps/ui/src/app/utils/test/page-objects/page-object.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { DebugElement } from '@angular/core';
import { ComponentFixture } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

Expand All @@ -9,23 +8,15 @@ export abstract class PageObject<ComponentType> {
this.fixture.detectChanges();
}

getDebugElementsByCss(cssSelector: string): DebugElement[] {
getDebugElementsByCss(cssSelector: string) {
return this.fixture.debugElement.queryAll(By.css(cssSelector));
}

getDebugElementByCss(cssSelector: string): DebugElement {
const debugElement = this.fixture.debugElement.query(By.css(cssSelector));

try {
expect(debugElement).toBeTruthy();
} catch {
throw new Error(`Element with selector "${cssSelector}" was not found.`);
}

return debugElement;
getDebugElementByCss(cssSelector: string) {
return this.fixture.debugElement.query(By.css(cssSelector));
}

getDebugElementByTestId(testId: string): DebugElement {
getDebugElementByTestId(testId: string) {
return this.getDebugElementByCss(`[data-test-id="${testId}"]`);
}
}
5 changes: 2 additions & 3 deletions apps/ui/src/app/utils/test/setup/setup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { TestBed } from '@angular/core/testing';
import { ComponentTestSetup } from './setup.model';
import { Type } from '@angular/core';
import { TestBed } from '@angular/core/testing';

export function testSetup<T>(type: Type<T>): ComponentTestSetup<T> {
export function testSetup<T>(type: Type<T>) {
const fixture = TestBed.createComponent(type);
const component = fixture.componentInstance;

Expand Down
Loading
Loading