Files
privacy.sexy/tests/unit/shared/Stubs/ReadbackFileWriterStub.ts
undergroundwires a721e82a4f Bump TypeScript to 5.3 with verbatimModuleSyntax
This commit upgrades TypeScript to the latest version 5.3 and introduces
`verbatimModuleSyntax` in line with the official Vue guide
recommendatinos (vuejs/docs#2592).

By enforcing `import type` for type-only imports, this commit improves
code clarity and supports tooling optimization, ensuring imports are
only bundled when necessary for runtime.

Changes:

- Bump TypeScript to 5.3.3 across the project.
- Adjust import statements to utilize `import type` where applicable,
  promoting cleaner and more efficient code.
2024-02-27 04:20:22 +01:00

30 lines
950 B
TypeScript

import type { FileWriteErrorType, FileWriteOutcome, ReadbackFileWriter } from '@/infrastructure/ReadbackFileWriter/ReadbackFileWriter';
import { StubWithObservableMethodCalls } from './StubWithObservableMethodCalls';
export class ReadbackFileWriterStub
extends StubWithObservableMethodCalls<ReadbackFileWriter>
implements ReadbackFileWriter {
private outcome: FileWriteOutcome = { success: true };
public writeAndVerifyFile(
...args: Parameters<ReadbackFileWriter['writeAndVerifyFile']>
): Promise<FileWriteOutcome> {
this.registerMethodCall({
methodName: 'writeAndVerifyFile',
args: [...args],
});
return Promise.resolve(this.outcome);
}
public configureFailure(errorType: FileWriteErrorType, message: string): this {
this.outcome = {
success: false,
error: {
type: errorType,
message: `[${ReadbackFileWriterStub.name}] ${message}`,
},
};
return this;
}
}