Skip to content

Commit

Permalink
Adds type tests for todoApp
Browse files Browse the repository at this point in the history
Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
  • Loading branch information
infomiho committed Apr 15, 2024
1 parent d68ba50 commit 5159036
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/waspc-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
- name: Run unit tests
run: cabal test cli-test waspc-test waspls-test

- name: Ensure todoApp builds
- name: Ensure todoApp works
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-latest'
run: ./tools/ensure_todoapp_builds.sh

Expand Down
4 changes: 3 additions & 1 deletion waspc/examples/todoApp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ export function App({ children }: any) {

const connectionIcon = isConnected ? '🟢' : '🔴'

const appName = import.meta.env.REACT_APP_NAME ? import.meta.env.REACT_APP_NAME : 'TODO App'

return (
<div className="app border-spacing-2 p-4">
<header className="flex justify-between">
<h1 className="font-bold text-3xl mb-5">
<Link to="/">ToDo App</Link>
<Link to="/">{appName}</Link>
</h1>
<h2>
Your site was loaded at: {date?.toLocaleString()} {connectionIcon}
Expand Down
3 changes: 3 additions & 0 deletions waspc/tools/ensure_todoapp_builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ cd "$dir/../examples/todoApp"
# Compile example app.
cabal run wasp-cli build

echo "Ensure the app has no IDE type errors"
npx tsc --noEmit --skipLibCheck

# Make sure they build.
echo "Ensure client builds"
cd .wasp/build/web-app
Expand Down

0 comments on commit 5159036

Please sign in to comment.