Skip to content

Commit

Permalink
chore(ui): improve hash parsing + test - WF-72
Browse files Browse the repository at this point in the history
It's possible to use `URLSearchParams` instead of complex Regex. As it's
a very testable part of the code, it was a good opportunity to introduce
Vitest and cover it.

This improvement made me realise that a bug was present, and we didn't
serialize the params when converting back the object to hash (`.key =
length` was not called).
  • Loading branch information
madeindjs committed Nov 28, 2024
1 parent ec53f21 commit bf22566
Show file tree
Hide file tree
Showing 6 changed files with 500 additions and 54 deletions.
1 change: 1 addition & 0 deletions alfred/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def ci(front, back, e2e, docs):
if front or no_flags:
alfred.invoke_command("npm.lint")
alfred.invoke_command("npm.build")
alfred.invoke_command("npm.ui.test")
if back or no_flags:
alfred.invoke_command("ci.mypy")
alfred.invoke_command("ci.ruff")
Expand Down
4 changes: 4 additions & 0 deletions alfred/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def npm_build_custom_components():
def npm_docs_test():
alfred.run("npm run docs:test")

@alfred.command("npm.ui.test", help="test against writer-ui")
def npm_ui_test():
alfred.run("npm run -w writer-ui test")

@alfred.command("npm.storybook", help="build storybook for continuous integration")
def npm_storybook():
os.chdir("src/ui")
Expand Down
Loading

0 comments on commit bf22566

Please sign in to comment.