Skip to content

Commit

Permalink
feat: add formatPlatform/formatAllPlatforms methods (#1222)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenbroekema committed Jun 28, 2024
1 parent 9f607cb commit c5ea8f5
Show file tree
Hide file tree
Showing 22 changed files with 1,835 additions and 2,695 deletions.
643 changes: 641 additions & 2 deletions __tests__/StyleDictionary.test.js

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions __tests__/__snapshots__/StyleDictionary.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,58 @@ Token collisions detected (7):
Use log.verbosity "verbose" or use CLI option --verbose for more details.`;
/* end snapshot StyleDictionary class + extend method collisions should throw a brief error if the collision is in source files and log is set to error and verbosity default */

snapshots["StyleDictionary class collisions should throw an error if the collision is in source files and log is set to error"] =
`
Token collisions detected (7):
Collision detected at: size.padding.zero! Original value: 0, New value: 0
Collision detected at: size.padding.tiny! Original value: 3, New value: 3
Collision detected at: size.padding.small! Original value: 5, New value: 5
Collision detected at: size.padding.base! Original value: 10, New value: 10
Collision detected at: size.padding.large! Original value: 15, New value: 15
Collision detected at: size.padding.xl! Original value: 20, New value: 20
Collision detected at: size.padding.xxl! Original value: 30, New value: 30
`;
/* end snapshot StyleDictionary class collisions should throw an error if the collision is in source files and log is set to error */

snapshots["StyleDictionary class collisions should throw a brief error if the collision is in source files and log is set to error and verbosity default"] =
`
Token collisions detected (7):
Use log.verbosity "verbose" or use CLI option --verbose for more details.`;
/* end snapshot StyleDictionary class collisions should throw a brief error if the collision is in source files and log is set to error and verbosity default */

snapshots["StyleDictionary class formatFile should support asynchronous formats"] =
`:root {
size-font-small: "12rem";
size-font-large: "18rem";
color-base-red: "#ff0000";
color-white: "#ffffff";
}
`;
/* end snapshot StyleDictionary class formatFile should support asynchronous formats */

snapshots["StyleDictionary class formatFile should support asynchronous fileHeader"] =
`/**
* foo
* bar
*/
:root {
--someName: value1;
}
`;
/* end snapshot StyleDictionary class formatFile should support asynchronous fileHeader */

snapshots["StyleDictionary class formatFile name collisions should generate warning messages for output name collisions"] =
`⚠️ __tests__/__output/test.collisions
While building __tests__/__output/test.collisions, token collisions were found; output may be unexpected. Ignore this warning if intentional.
 Output name someName was generated by:
 some.name.path1 value1
 some.name.path2 value2
This many-to-one issue is usually caused by some combination of:
 * conflicting or similar paths/names in token definitions
 * platform transforms/transformGroups affecting names, especially when removing specificity
 * overly inclusive file filters`;
/* end snapshot StyleDictionary class formatFile name collisions should generate warning messages for output name collisions */

294 changes: 0 additions & 294 deletions __tests__/buildFile.test.js

This file was deleted.

Loading

0 comments on commit c5ea8f5

Please sign in to comment.