Skip to content

Commit

Permalink
fix: lint unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Jan 21, 2024
1 parent c155614 commit 46a116b
Show file tree
Hide file tree
Showing 168 changed files with 1,966 additions and 1,873 deletions.
2 changes: 1 addition & 1 deletion projects/aas-lib/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../.eslintrc.json",
"ignorePatterns": [
"!**/*"
"src/test/assets/**/*"
],
"overrides": [
{
Expand Down
2 changes: 1 addition & 1 deletion projects/aas-portal/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../.eslintrc.json",
"ignorePatterns": [
"!**/*"
"src/test/assets/**/*"
],
"overrides": [
{
Expand Down
3 changes: 2 additions & 1 deletion projects/aas-server/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"extends": "../../.eslintrc.json"
"extends": "../../.eslintrc.json",
"ignorePatterns": ["src/test/assets/**/*"]
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-index/aas-index-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ export class AASIndexFactory {
const db = new Low<LowDbData>(new JSONFile(dbFile), { documents: [], endpoints: [], elements: [] });
return new LowDbIndex(db, variable);
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-index/aas-index-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ export abstract class AASIndexQuery {
protected isExpression(value: unknown): value is OrExpression[] {
return Array.isArray(value);
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-index/aas-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ export abstract class AASIndex {

return undefined;
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-index/lowdb/lowdb-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,4 @@ export class LowDbIndex extends AASIndex {

this.db.data.elements.push(element);
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-index/lowdb/lowdb-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ export class LowDbQuery extends AASIndexQuery {
return Date.parse(s);
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-index/lowdb/lowdb-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ export interface LowDbData {
endpoints: AASEndpoint[];
documents: LowDbDocument[];
elements: LowDbElement[];
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-index/mysql/mysql-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,4 @@ export class MySqlIndex extends AASIndex {
);
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-index/mysql/mysql-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ export class MySqlQuery extends AASIndexQuery {
private toMySqlOperator(operator: AASQueryOperator): string {
return operator === '!=' ? '<>' : operator;
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-index/mysql/mysql-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export interface MySqlElement extends RowDataPacket {
numberValue?: number;
dateValue?: Date;
booleanValue?: boolean;
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-provider/aas-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,4 +553,4 @@ export class AASProvider {
await resource.closeAsync();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ export class AASResourceScanFactory {
private createLocalFileStorage(url: URL): FileStorage {
return this.fileStorageFactory.create(`file:///endpoints` + url.pathname);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ import { AASDocument } from 'common';
export abstract class AASResourceScan extends EventEmitter {
/** Gets all documents of the current container. */
public abstract scanAsync(): Promise<AASDocument[]>;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ export class AASXServerScan extends AASResourceScan {
await this.server.closeAsync();
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-provider/directory-scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export class DirectoryScan extends AASResourceScan {
await this.source.closeAsync();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ export class OpcuaServerScan extends AASResourceScan {

return node.value.value as QualifiedName;
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-provider/parallel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ export class Parallel extends EventEmitter {
noop();
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-provider/scan-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export interface ScanContainerResult extends ScanResult {
container: AASContainer;
/** The result subject. */
document: AASDocument;
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-provider/worker-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export interface ScanContainerData extends WorkerData {

export function isScanContainerData(data: WorkerData): data is ScanContainerData {
return data.type === 'ScanContainerData';
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-scan-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ container.registerInstance(
);

const app = container.resolve(WorkerApp);
app.run();
app.run();
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/aas-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ container.afterResolution(
);

container.resolve(WSServer).run();
container.resolve(AASProvider);
container.resolve(AASProvider);
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ export class App {
private getIndex = (req: Request, res: Response) => {
res.sendFile(this.variable.WEB_ROOT + '/index.html');
};
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/application-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ export class ApplicationInfo {
};
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/auth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,4 @@ export class AuthService {
private createPassword(): string {
return Math.random().toString(36).slice(-8);
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/cookie-storage-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ export class CookieStorageFactory {
logger.info(`Using locale user database.`);
return storage;
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/cookie-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ export abstract class CookieStorage {
* @param name The cookie name.
*/
public abstract deleteAsync(id: string, name: string): Promise<void>;
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/locale-cookie-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ export class LocaleCookieStorage extends CookieStorage {
return [];
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/locale-user-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ export class LocaleUserStorage extends UserStorage {
private getUserDir(userId: string): string {
return path.join(this.usersDirectory, userId);
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/mongo-db-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ export class MongoDBConnection {
this.connected = true;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ export class MongoDBCookieStorage extends CookieStorage {
}
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/mongo-db-user-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ export class MongoDBUserStorage extends UserStorage {
await this.connection.ensureConnected();
return (await this.model.findOneAndDelete({ id: userId }).exec()) != null;
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/user-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export type UserData = {
created: Date;
/** The date and time of the last login. */
lastLoggedIn: Date;
};
};
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/user-storage-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ export class UserStorageFactory {
logger.info(`Using local user storage.`);
return storage;
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/auth/user-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ export abstract class UserStorage {
* @returns `true` if the specified user was successfully deleted; otherwise, `false`.
*/
public abstract deleteAsync(userId: string): Promise<boolean>;
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ export function endpointUrl(url: string, name: string, type: AASEndpointType, ve
}

return value;
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/controller/aas-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export abstract class AASController extends Controller {
) {
super();
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/controller/app-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ export class AppController extends AASController {
this.logger.stop();
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/controller/auth-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ export class AuthController extends AASController {
public deleteCookie(@Path() id: string, @Path() name: string): Promise<void> {
return this.auth.deleteCookieAsync(decodeBase64Url(id), name);
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/controller/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ export async function expressAuthentication(req: Request, name: string, scopes?:
}

throw new ApplicationError('Unauthorized access.', ERRORS.UnauthorizedAccess);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,4 @@ export class ContainersController extends AASController {
this.logger.stop();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ export class DocumentsController extends AASController {
this.logger.stop();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ export class EndpointsController extends AASController {
this.logger.stop();
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/controller/ioc-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export const iocContainer: IocContainer = {
get: <T>(controller: { prototype: T }): T => {
return container.resolve<T>(controller as never);
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export class TemplatesController extends AASController {
this.logger.stop();
}
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ export function parseUrl(url: string): URL {

export function toUint8Array<T extends object>(data: T): Uint8Array {
return Uint8Array.from(Buffer.from(JSON.stringify(data)));
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ export const ERRORS = {
DeleteAASNotSupported: 'ERROR_DELETE_AAS_NOT_SUPPORTED',
InvalidContainerUrl: 'ERROR_INVALID_CONTAINER_URL',
InvokeOperationFailed: 'ERROR_INVOKE_OPERATION_FAILED',
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export class FileStorageFactory {

throw new Error('Not implemented.');
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/file-storage/file-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export abstract class FileStorage {
public abstract unlink(path: string): Promise<void>;
public abstract rename(oldPath: string, newPath: string): Promise<void>;
public abstract createReadStream(path: string): NodeJS.ReadableStream;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ export class LocalFileStorage extends FileStorage {
public createReadStream(path: string): NodeJS.ReadableStream {
return fs.createReadStream(resolve(this.root, path));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ export class OwnCloudStorage extends FileStorage {
public createReadStream(path: string): NodeJS.ReadableStream {
throw new Error('Method not implemented.');
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/image-processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ export class ImageProcessing {
stream.push(null);
return stream;
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/lazy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ export class Lazy<T> {

return this._value;
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/live/empty-subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export class EmptySubscription extends SocketSubscription {
public close(): void {
noop();
}
}
}
2 changes: 1 addition & 1 deletion projects/aas-server/src/app/live/http/http-socket-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export class HttpSocketItem implements SocketItem {
public unsubscribe(): void {
noop();
}
}
}
Loading

0 comments on commit 46a116b

Please sign in to comment.