This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-14
Channels
- # announcements (2)
- # aws (1)
- # babashka (18)
- # babashka-sci-dev (103)
- # beginners (165)
- # calva (51)
- # cider (8)
- # circleci (1)
- # clj-kondo (22)
- # clj-on-windows (2)
- # cljdoc (1)
- # cljfx (31)
- # cljs-dev (16)
- # clojure (81)
- # clojure-europe (71)
- # clojure-nl (7)
- # clojure-uk (11)
- # clojurescript (20)
- # code-reviews (26)
- # conjure (1)
- # contributions-welcome (1)
- # core-async (15)
- # cursive (8)
- # datomic (8)
- # defnpodcast (2)
- # eastwood (24)
- # emacs (10)
- # events (1)
- # fulcro (4)
- # funcool (31)
- # graalvm (43)
- # graphql (8)
- # honeysql (9)
- # introduce-yourself (1)
- # jobs (12)
- # kaocha (3)
- # lsp (28)
- # malli (4)
- # meander (4)
- # membrane (7)
- # off-topic (64)
- # other-languages (3)
- # pedestal (1)
- # polylith (31)
- # portal (5)
- # re-frame (4)
- # reitit (1)
- # releases (5)
- # rum (2)
- # schema (2)
- # sci (34)
- # shadow-cljs (21)
- # vscode (1)
hi all ... is there a straightforward way to mock out re-frame's globals so that I can test some non-DOM-related code in a namespace that requires re-frame? My node-based kaocha-cljs suite breaks the instant I add a test that requires a re-frame containing namespace, based on not being able to find xmlhttprequest
and window
. Looks like just adding the xmlhttprequest
and window
npms isn't helping. I'm thinking including a simple JS file that has window = {}
(no var
or let
) would do it here.
Ok so I think I'm back to this being a kaocha q ... in #re-frame the advice is to set up a preload for stubbing in globals (see https://gist.github.com/rgm/0af06f2c35aced5079b66a79081993d2). I'm hoping I'm close, but I can't seem to get "STUBBING"
to print (even with --no-capture-output
), plus I'm still erroring on a missing window
global in a node test run. So I'm not entirely convinced the stub is running.
The error I'm getting is :message "Execution error (ReferenceError) at (<cljs repl>:1).\nwindow is not defined\n"
. I wouldn't expect entirely smooth sailing when window
is defined as an empty JS object, but I would expect to get the next interesting error instead of this one.