diff --git a/lib/codecept.js b/lib/codecept.js index 59d77cd34..dc9c6bd7a 100644 --- a/lib/codecept.js +++ b/lib/codecept.js @@ -122,6 +122,7 @@ class Codecept { /** * Executes bootstrap. * + * @returns {Promise} */ async bootstrap() { return runHook(this.config.bootstrap, 'bootstrap') @@ -129,7 +130,8 @@ class Codecept { /** * Executes teardown. - + * + * @returns {Promise} */ async teardown() { return runHook(this.config.teardown, 'teardown') @@ -262,6 +264,11 @@ class Codecept { }) } + /** + * Returns the version string of CodeceptJS. + * + * @returns {string} The version string. + */ static version() { return JSON.parse(readFileSync(`${__dirname}/../package.json`, 'utf8')).version } diff --git a/typings/index.d.ts b/typings/index.d.ts index a5716cecd..31fbe702d 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -97,7 +97,7 @@ declare namespace CodeceptJS { * tests: 'tests/**.test.ts' * ``` */ - tests: string + tests: string | string[] /** * Where to store failure screenshots, artifacts, etc * @@ -520,17 +520,16 @@ declare namespace CodeceptJS { } } -type TryTo = (fn: () => Promise | T) => Promise; -type HopeThat = (fn: () => Promise | T) => Promise; -type RetryTo = (fn: () => Promise | T, retries?: number) => Promise; - +type TryTo = (fn: () => Promise | T) => Promise +type HopeThat = (fn: () => Promise | T) => Promise +type RetryTo = (fn: () => Promise | T, retries?: number) => Promise // Globals declare const codecept_dir: string declare const output_dir: string -declare const tryTo: TryTo; -declare const retryTo: RetryTo; -declare const hopeThat: HopeThat; +declare const tryTo: TryTo +declare const retryTo: RetryTo +declare const hopeThat: HopeThat declare const actor: CodeceptJS.actor declare const codecept_actor: CodeceptJS.actor @@ -643,7 +642,7 @@ declare module '@codeceptjs/helper' { } declare module 'codeceptjs/effects' { - export const tryTo: TryTo; - export const retryTo: RetryTo; - export const hopeThat: HopeThat; + export const tryTo: TryTo + export const retryTo: RetryTo + export const hopeThat: HopeThat }