Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch to testing via lein test. Refs #34.

  • Loading branch information...
commit fb5c6ffd395e5485af42eeccaa68d1c2785e0619 1 parent c4b268f
Craig Andera candera authored
22 test/one/sample/test/integration.clj
View
@@ -2,7 +2,27 @@
"Tests which cross the client server boundary."
(:use [clojure.test]
[one.sample.api :only (*database*)]
- [one.test :only (cljs-eval cljs-wait-for)]))
+ [one.test :only (cljs-eval cljs-wait-for)]
+ [clojure.java.browse :only (browse-url)]
+ [cljs.repl :only (-setup -tear-down)]
+ [cljs.repl.browser :only (repl-env)]
+ [one.test :only (*eval-env*)]
+ [one.sample.dev-server :only (run-server)]))
+
+(defn setup
+ "Start the development server and connect to the browser so that
+ ClojureScript code can be evaluated from tests."
+ [f]
+ (let [server (run-server)
+ eval-env (repl-env)]
+ (-setup eval-env)
+ (browse-url "http://localhost:8080/development")
+ (binding [*eval-env* eval-env]
+ (f))
+ (-tear-down eval-env)
+ (.stop server)))
+
+(use-fixtures :once setup)
(deftest test-enter-new-name
(reset! *database* #{})
25 test/one/sample/test/suite.clj
View
@@ -1,25 +0,0 @@
-(ns one.sample.test.suite
- "Test suites for this application."
- (use [clojure.java.browse :only (browse-url)]
- [clojure.test]
- [cljs.repl :only (-setup -tear-down)]
- [cljs.repl.browser :only (repl-env)]
- [one.test :only (*eval-env*)]
- [one.sample.dev-server :only (run-server)]
- [one.sample.test.api]
- [one.sample.test.integration]))
-
-(defn run-all
- "Run all of the tests for this application. Start the development
- server and connect to the browser so that ClojureScript code can be
- evaluated from tests."
- []
- (let [server (run-server)
- eval-env (repl-env)]
- (-setup eval-env)
- (browse-url "http://localhost:8080/development")
- (binding [*eval-env* eval-env]
- (run-tests 'one.sample.test.api
- 'one.sample.test.integration))
- (-tear-down eval-env)
- (.stop server)))
Please sign in to comment.
Something went wrong with that request. Please try again.