as i'm hacking on lucee and feeling lazy, reckon i...
# box-products
z
as i'm hacking on lucee and feeling lazy, reckon i've earned the ability to ask a lazy q how do a mock out a big nasty query with mockbox?
t
no idea if it would work but do a file read as the arguments to querysim https://testbox.ortusbooks.com/mocking/mockbox/mocking-methods/usdquerysim-method and knock ups some gnarly query in vi
a
myDependency.$("theMethod").$(queryNew(etc))
If the query has to be "big nasty" for your test, then I think your test might be less than ideal.
There's no gain in using
querysim
these days now that
queryNew
can take the data as well
💯 2
a
that said, could save the querysim string in a file to get it out of the way of your test code, I guess. I'd perhaps do the same with JSON and
queryNew
still though.
Ugh, Zac.
Just build an array of arrays add pass it to
queryNew
z
been a long day and a lot of swearing at my computer, so good enough was ok
a
Copy code
filler = "lucee".repeatString(1000)
q = queryNew(
    "id,name,data",
    "integer,varchar, varchar",
    ["micha","zac","brad","pothys","gert"].map((v,i) => [i, v, filler])
)