Skip to content

Commit

Permalink
fix jasmine type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
just-boris committed Jul 17, 2021
1 parent 5c295b6 commit df41a36
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/allure-jasmine/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { JasmineAllureReporter } from "../src/JasmineAllureReporter";
import Env = jasmine.Env;

export interface JasmineTestEnv extends Env {
// These functions are not available in the public Jasmine API
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/51999#issuecomment-832961442
// TODO: figure out how to refactor tests without using them
expect(actual: any): any;
describe(name: string, content: () => void): void;
xdescribe(name: string, content: () => void): void;
it(name: string, content: () => void): void;
}

export async function runTest(fun: (testEnv: JasmineTestEnv, testAllure: Allure) => void) {
Expand All @@ -21,13 +27,13 @@ export async function runTest(fun: (testEnv: JasmineTestEnv, testAllure: Allure)
}

export function delay(ms: number) {
return new Promise<void>(function(resolve) {
return new Promise<void>(function (resolve) {
setTimeout(resolve, ms);
});
}

export function delayFail(ms: number) {
return new Promise<void>(function(resolve, reject) {
return new Promise<void>(function (resolve, reject) {
setTimeout(() => reject(new Error("Async error")), ms);
});
}
Expand Down

0 comments on commit df41a36

Please sign in to comment.