Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate most tests to the module system #2003

Merged
merged 11 commits into from
Jul 8, 2024
Merged

Conversation

jathak
Copy link
Member

@jathak jathak commented Jul 1, 2024

This migrates most tests that aren't explicitly testing @import or global built-in functions to instead use @use and the sass: modules.

This was done using a combination of a new migrate.ts script that can run the Sass migrator over a spec directory and some manual changes and refactorings. There are probably some tests that could have been migrated that this misses because there were some directories I avoided running the migrator over to avoid accidentally changing a test that's actually explicitly testing @import, but this should at least minimize additional migration and new warnings we need to add when we actually deprecate @import and global built-in functions.

The spec/core_functions/module directory has been replaced with spec/core_functions/global, which similarly contains minimal tests for the global versions of each built-in function now that their full functionality is tested using the module system versions.

@jathak jathak requested a review from nex3 July 2, 2024 00:13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For functions like this that are just translated into other, more general functions, it probably makes sense to omit them from the new module system tests entirely and have a small global test to verify that the name still works.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the detailed tests for the color.adjust shorthands. The basic tests for the global versions are already in spec/core_functions/global/color and spec/core_functions/color/adjust_color/error/missing_globals tests that the functions that were removed or changed names in the module system don't exist in the color module.

@jathak jathak requested a review from nex3 July 8, 2024 17:12
@jathak jathak merged commit 81545a9 into main Jul 8, 2024
18 checks passed
@jathak jathak deleted the module-system-migration branch July 8, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants