feat: 서버는 기초의 테스트 더함
All checks were successful
build / build (push) Successful in 4s

This commit was merged in pull request #25.
This commit is contained in:
2026-03-24 14:58:31 -06:00
parent 79735cc0ba
commit fb2974bb21
7 changed files with 57 additions and 35 deletions

View File

@@ -0,0 +1,24 @@
(ns net.deertopia.publisher.server-test
(:require [net.deertopia.publisher.server :as sut]
[reitit.ring]
[clojure.test :as t]
[clojure.set :as set]
[net.deertopia.publisher.server :as server]
[net.deertopia.publisher.config :as cfg]
[net.deertopia.publisher :as-alias publisher]))
(t/deftest server-is-running
;; 서버가 벌써 시작한 다음에 이 테스트 하면 잘못됩니다.
(assert (not= :running (server/status)))
(server/start!)
(t/is (= :running (server/status)))
(server/stop!))
(t/deftest can-get-real-server-root
;; 서버가 벌써 시작한 다음에 이 테스트 하면 잘못됩니다.
(assert (not= :running (server/status)))
(server/start!)
(t/is (->> (format "http://localhost:%d" (::publisher/port cfg/*cfg*))
slurp
string?))
(server/stop!))