fix!: remove global helpers (it,describe,...)#1261
Open
KuznetsovRoman wants to merge 1 commit into
Open
Conversation
✅ Testplane E2E run succeed
|
✅ Testplane browser-env run succeed
|
KuznetsovRoman
commented
May 25, 2026
| import type { TestDefinition, SuiteDefinition, TestHookDefinition } from "./test-reader/test-object/types"; | ||
| export type { TestDefinition, SuiteDefinition, TestHookDefinition }; | ||
|
|
||
| declare global { |
Member
Author
There was a problem hiding this comment.
Now we dont pollute global by default
| export type GlobalTestplaneType = GlobalHelper; | ||
| export type GlobalHermioneType = GlobalHelper; | ||
|
|
||
| export type TestplaneGlobals = { |
Member
Author
There was a problem hiding this comment.
Instead, we have type of testplane-related globals to use
Comment on lines
+11
to
+16
| export const it: GlobalItType = (globalThis as unknown as TestplaneGlobals).it; | ||
| export const describe: GlobalDescribeType = (globalThis as unknown as TestplaneGlobals).describe; | ||
| export const beforeEach: GlobalBeforeEachType = (globalThis as unknown as TestplaneGlobals).beforeEach; | ||
| export const afterEach: GlobalAfterEachType = (globalThis as unknown as TestplaneGlobals).afterEach; | ||
| export const testplane: GlobalTestplaneType = (globalThis as unknown as TestplaneGlobals).testplane; | ||
| export const hermione: GlobalHermioneType = (globalThis as unknown as TestplaneGlobals).hermione; |
Member
Author
There was a problem hiding this comment.
Types of globals are exported instead of being declared
So user could type:
import {it, describe} from "testplane";Also same exported types will be used in "@testplane/globals"
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.