Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cwithmichael committed Dec 8, 2024
1 parent e22bd09 commit d5d80cd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@ name: ci

on: [push]
jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

# It is important to install java before installing clojure tools which needs java
# exclusions: babashka, clj-kondo and cljstyle
- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "8"

- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@13.0
with:
# Install just one or all simultaneously
# The value must indicate a particular version of the tool, or use 'latest'
# to always provision the latest version
cli: latest # Clojure CLI based on tools.deps
bb: latest # Babashka
clj-kondo: 2022.05.31 # Clj-kondo
- name: run linting
run: clj-kondo --lint src
- name: run tests
run: bb test
docker:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
Expand Down
8 changes: 4 additions & 4 deletions test/clj/cwithmichael/what_can_u_eat/core_test.clj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns cwithmichael.what-can-u-eat.core-test
(:require
[cwithmichael.what-can-u-eat.test-utils :as utils]
[clojure.test :refer :all]))
[clojure.test :refer :all]
[cwithmichael.what-can-u-eat.web.controllers.food :refer [calculate-net-carbs]]))

(deftest example-test
(is (= 1 2)))
(deftest calculate-net-carbs-test
(is (= (calculate-net-carbs 4 6) 2)))

0 comments on commit d5d80cd

Please sign in to comment.