Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reporting unresolved symbol for test symbols in cljc files #335

Closed
lread opened this issue Jul 9, 2019 · 4 comments
Closed

reporting unresolved symbol for test symbols in cljc files #335

lread opened this issue Jul 9, 2019 · 4 comments

Comments

@lread
Copy link
Contributor

lread commented Jul 9, 2019

version
clj-kondo v2019.07.06-alpha-SNAPSHOT (on 2019-07-09)

platform
macOS

problem
clj-kondo will inform of missing symbols for thrown-with-msg? and missing symbols related to are in cljc files

repro
borkdude_test.cljc

(ns borkdude-test
  (:require [clojure.test :refer [deftest is are]])
  #?(:clj (:import clojure.lang.ExceptionInfo)))

(deftest are-test
  (are [?a ?b]
      (is (= ?a (dec ?b)))
    1 2
    10 11
    14 15))

(deftest thown-with-msg-test
  (is (thrown-with-msg? ExceptionInfo #"uh oh" (throw (ex-info "uh oh" {})))))

expected behavior
clj-kondo reports no problems

actual behavior
clj-kondo reports missing symbols for ?a, ?b and thrown-with-msg?

work-around
add the following to your clj-kondo/config.edn:

{:linters
 {:unresolved-symbol
  {:exclude [(cljs.test/are)
             (cljs.test/is [thrown-with-msg?])]}}}
@lread lread changed the title cljc files reporting unresolved symbol for test symbols reporting unresolved symbol for test symbols in cljc files Jul 9, 2019
@lread
Copy link
Contributor Author

lread commented Jul 9, 2019

Very much related: thrown should be added to exclude vector for both clojure.test/is and cljs.test/is

@borkdude
Copy link
Member

@borkdude
Copy link
Member

Fixed with c795c44

@lread
Copy link
Contributor Author

lread commented Jul 11, 2019

thanks, I tried it and it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants