<commit_before>(ns rksm.cloxp-com.browser-client-test
  (:require [rksm.cloxp-com.server :as server]
            [cljs-slimerjs-tester.core :as tester]
            [clojure.test :refer :all]))

(defn abs-path [rel-path]
  (->>
    rel-path
    (clojure.java.io/file ".")
    .getCanonicalPath))

(defn fixture [test]
  (let [server (server/ensure-server! :port 8084)]
    (test)
    (server/stop-server! server)))

(use-fixtures :each fixture)

(deftest all-cljs-tests
  (let [{:keys [test pass fail error]}
        (tester/run-tests (abs-path "cloxp-cljs-build/")
                          ["/cloxp-cljs.js"]
                          'rksm.cloxp-com.test-runner/runner
                          {:port 8095 :timeout 10000})]
    (is (zero? fail))
    (is (zero? error))))

(comment
 (test-ns *ns*)
 )
<commit_msg>fixing browser tests<commit_after>(ns rksm.cloxp-com.browser-client-test
  (:require [rksm.cloxp-com.server :as server]
            [cljs-slimerjs-tester.core :as tester]
            [clojure.test :refer :all]))

(defn abs-path [rel-path]
  (->>
    rel-path
    (clojure.java.io/file ".")
    .getCanonicalPath))

(defn fixture [test]
  (let [server (server/ensure-server! :port 8084)]
    (test)
    (server/stop-server! server)))

(use-fixtures :each fixture)

(deftest all-cljs-tests
  (let [{:keys [test pass fail error]}
        (tester/run-tests (abs-path "cloxp-cljs-build/")
                          ["/out/goog/base.js" "/cloxp-cljs.js"]
                          'rksm.cloxp-com.test-runner/runner
                          {:port 8095 :timeout 10000})]
    (is (zero? fail))
    (is (zero? error))))

(comment
 (test-ns *ns*)
 )

{'fraction_non_alphanumeric': 0.16656608328304165, 'fraction_numerical': 0.015691007845503924, 'mean_word_length': 2.1762452107279695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6808211', 'n_tokens_mistral': 644, 'n_tokens_neox': 620, 'n_words': 119}