Skip to content

Commit

Permalink
Add specific test coverage for string requires
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv committed Jul 29, 2022
1 parent beaa226 commit 765bf96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 12 additions & 1 deletion test-resources/cljsns.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
[cljs.pprint :as pprint]
[js-literal-ns :as js-literal]
[keyword-ns :as kw]
[clojure.set :as set])
[clojure.set :as set]
["react" :as react]
["underscore$default" :as underscore]
["react-UNUSED" :as react-unused]
["underscore-UNUSEd$default" :as underscore-unused])
(:require-macros [cljs.test :refer [testing]]
[cljs.analyzer.macros :as am]
cljs.analyzer.api)
Expand All @@ -18,6 +22,13 @@
(set/intersection #{1 2} #{1})
(split-lines "ok"))

(defn use-string-requires
"Uses string requires as found in the ns declaration.
Does not use the stuff marked as UNUSED, which therefore should be removed."
[]
(react/foo underscore/bar))

(deftest tt
(testing "whatever"
(is (= 1 1))))
Expand Down
4 changes: 3 additions & 1 deletion test-resources/cljsns_cleaned.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(ns cljsns
(:require [cljs.pprint :as pprint]
(:require ["react" :as react]
["underscore$default" :as underscore]
[cljs.pprint :as pprint]
[cljs.test :refer-macros [deftest is]]
[cljsjs.js-yaml]
[clojure.set :as set]
Expand Down

0 comments on commit 765bf96

Please sign in to comment.