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

chore: tests for ast-manipulation #17

Merged
merged 28 commits into from
Sep 5, 2024
Merged

Conversation

manuel3108
Copy link
Member

@manuel3108 manuel3108 commented Sep 1, 2024

This adds initial testing capabilities to ast-manipulation

Things to consider:

  • adding / comiting empty input.ts files is probably useless. Removing them on the other side could cause confusion why some files have that file and some do not
  • Those tests are pretty basic. The goal here was not test everything but rather to provide a good basis. Adding new tests should be straightforward.

Todos:

  • tests for html utilities
  • tests for css utilities
  • fix default-export test
  • fix named-export test
  • fix named-import-merging test (@AdrianGonz97 didn't you worked on that in the past? Would you mind linking / contributing the relevant code?)

@manuel3108 manuel3108 force-pushed the chore/tests-for-ast-manipulation branch from bb4c20e to d630f5f Compare September 1, 2024 13:55
Copy link

pkg-pr-new bot commented Sep 1, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/sveltejs/cli/@svelte-cli/ast-manipulation@17
pnpm add https://pkg.pr.new/sveltejs/cli/@svelte-cli/ast-tooling@17
pnpm add https://pkg.pr.new/sveltejs/cli/sv@17
pnpm add https://pkg.pr.new/sveltejs/cli/@svelte-cli/core@17

commit: f83e9f2

@AdrianGonz97
Copy link
Member

AdrianGonz97 commented Sep 2, 2024

fix named-import-merging test (@AdrianGonz97 didn't you worked on that in the past? Would you mind linking / contributing the relevant code?)

this can be found here: https://github.com/svelte-add/svelte-add/pull/543/files#diff-a7d866907aebe643d4f4ac035b89e786ccbd073912df653bccb8ccc579a4da69

@manuel3108
Copy link
Member Author

Thanks, that indeed fixes the test.

@manuel3108 manuel3108 changed the title DRAFT: chore: tests for ast-manipulation chore: tests for ast-manipulation Sep 4, 2024
Copy link
Member

@AdrianGonz97 AdrianGonz97 left a comment

Choose a reason for hiding this comment

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

overall, this looks really good! just a few minor changes are needed.

adding / comiting empty input.ts files is probably useless. Removing them on the other side could cause confusion why some files have that file and some do not

im in two minds about this. on one end, i get it for the sake of consistency. on the other, it does needlessly clutter up directories.

i think im leaning more towards the latter, though. we'll be alright if they're deleted

packages/ast-manipulation/js/exports.ts Outdated Show resolved Hide resolved
packages/ast-tooling/index.ts Outdated Show resolved Hide resolved
packages/ast-manipulation/vitest.config.ts Outdated Show resolved Hide resolved
packages/ast-manipulation/test/js/index.ts Outdated Show resolved Hide resolved
Copy link
Member

@AdrianGonz97 AdrianGonz97 left a comment

Choose a reason for hiding this comment

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

perfect!

@manuel3108 manuel3108 merged commit 3a43006 into main Sep 5, 2024
5 checks passed
@manuel3108 manuel3108 deleted the chore/tests-for-ast-manipulation branch September 5, 2024 18:05
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