Skip to content

Commit

Permalink
internal: provide AllureRuntime#bind method
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Dec 15, 2023
1 parent 71f85e1 commit 9a865a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/runtime/AllureRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ export class AllureRuntime implements IAllureRuntime {
this.#now = config.nowProvider;
}

bind(config: Partial<AllureRuntimeConfig>): AllureRuntime {
return new AllureRuntime({
attachmentsHandler: config.attachmentsHandler ?? this.#attachmentsHandler,
metadataProvider: config.metadataProvider ?? this.#metadataProvider,
nowProvider: config.nowProvider ?? this.#now,
});
}

async flush(): Promise<void> {
await this.#idle;
}
Expand Down
3 changes: 0 additions & 3 deletions src/runtime/IAllureRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import type {
import type { Function_, MaybePromise } from '../utils/types';

export interface IAllureRuntime {
// TODO: hide this method
flush(): Promise<void>;

description(value: string): void;

descriptionHtml(value: string): void;
Expand Down

0 comments on commit 9a865a1

Please sign in to comment.