Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Commit

Permalink
Add simple tests for spec completions
Browse files Browse the repository at this point in the history
  • Loading branch information
arichiardi committed Sep 25, 2017
1 parent ba5db1b commit 4098577
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/test/lumo/lumo/repl_tests.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns lumo.repl-tests
(:require [cljs.nodejs :as node]
[cljs.test :refer [deftest is testing use-fixtures]]
[cljs.spec.alpha :as s]
[lumo.repl :as lumo]
[lumo.common :as common]
[lumo.test-util :as test-util]))
Expand Down Expand Up @@ -103,7 +104,18 @@
(is-contains-completion "(MER" "(merge"))
(testing "JS completions"
(is-contains-completion "(require 'goog.m" "(require 'goog.math")
(is-contains-completion "g/isF" "g/isFunction"))))
(is-contains-completion "g/isF" "g/isFunction"))
(testing "Spec completions"
(testing "namespace fully qualified completion"
(s/def ::a-spec string?)
(is-contains-completion ":lumo.repl-tests/" ":lumo.repl-tests/a-spec")
(reset! s/registry-ref {}))
(testing "arbitrary fully qualified keyword"
(s/def :arbitrary/a-spec string?)
(is-contains-completion ":arbitrary/" ":arbitrary/a-spec")
(reset! s/registry-ref {})))))



(deftest test-root-resource
(is (= (lumo/root-resource 'foo-bar-baz) "/foo_bar_baz"))
Expand Down

0 comments on commit 4098577

Please sign in to comment.