-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@griffel-core-cb8022d0-7662-4724-a582-c6536e4413fc.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "fix: use global constants", | ||
"packageName": "@griffel/core", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
it('hosts global constants', async () => { | ||
const importA = await import('./constants'); | ||
|
||
// We are reloading a module, so instances that are created inside a module will be different | ||
// https://jestjs.io/docs/jest-object#jestresetmodules | ||
jest.resetModules(); | ||
const importB = await import('./constants'); | ||
|
||
expect(importA.DEFINITION_LOOKUP_TABLE).toBe(importA.DEFINITION_LOOKUP_TABLE); | ||
expect(importA.DEBUG_RESET_CLASSES).toBe(importA.DEBUG_RESET_CLASSES); | ||
|
||
// This constant is not global, expected to be different | ||
expect(importA.UNSUPPORTED_CSS_PROPERTIES).not.toBe(importB.UNSUPPORTED_CSS_PROPERTIES); | ||
}); |
This file contains 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