spitballing about jest mocks
ok. ok. ok. pure spitballing theory here.
All the client side source exists in esmodule form (hopefully importing from eachother?)
So then it stands to reason that a jest instance could instanciate an actual
Game
instance as though it were actually an active game session. With something that mocks out a browser standing in for all the browser APIs, "All you'd need to mock" would be the socket connection server calls.C
Calego•721d ago
crazy train thread
Authentication might be a hurdle.
UU
Unknown User•721d ago
C
Calego•721d ago
client/game.js
oh i see
doesn't exportUU
Unknown User•721d ago
C
Calego•721d ago
mmm these files don't actually import or export things...
wtf
UU
Unknown User•721d ago
C
Calego•721d ago
You could even mock out
update
method if you needed toUU
Unknown User•721d ago
C
Calego•721d ago
my dist/ directory looks minified
UU
Unknown User•721d ago
C
Calego•721d ago
test/common/utils/helpers.test.mjs
👀
so the common
is a module in module formUU
Unknown User•721d ago
C
Calego•721d ago
but the actual client files must get like 'concatenated' as the build process or something
I'm looking in
resources/app/
from the foundry installation node versionUU
Unknown User•721d ago
C
cswendrowski•721d ago
this file tests our helpers, it does not help with testing
C
Calego•721d ago
aye, i was looking to see how it got the method it was testing, which turns out comes from an actual esmodule
C
cswendrowski•721d ago
you could check out
test/harness.mjs
if it's there
common
is a module, so we can test it much easier than client codeUU
Unknown User•721d ago
C
Calego•721d ago
its not the worst idea in the world lol
UU
Unknown User•721d ago
C
Calego•721d ago
yeah
UU
Unknown User•721d ago
C
Calego•721d ago
lol
I mean what you have is gonna work fine for simple tests
oh i just read where you figured this is the server code isntead of client code. damn
UU
Unknown User•721d ago
C
Calego•721d ago
https://jestjs.io/docs/es6-class-mocks
This is what I was hoping was possible, but isn't with the client files not exporting things
UU
Unknown User•720d ago
Want results from more Discord servers?
More Posts1.6.1 testing@dnd5e Testing Action Requested but not required.
version 1.6.1 is a bugfix version, it's pretty clconversion macro@max.pat did you have a macro or script which could change the old classFeatures data into advancemeAC calc changesI do not believe the data for AC actually changed, only the way it is calculated.
evidence: no chang1.6.0 Custom Sheet ChangesLooking at the changes made which are breaking for custom sheets. Gonna make a thread for this.1.6.0 testingCommunity Testing Requests:
For those of you interested in helping to QA this branch, I'll put togeHook documentationdnd5e Hook Documentation:
https://gitlab.com/foundrynet/dnd5e/-/wikis/HooksTyphonJS Runtime Library v0.0.9 - Release CandidateAlrighty! The TyphonJS Runtime Library (TRL) v0.0.9 is out... In the last 2 weeks+ I have done massi1.6.0 - 82%@dnd5e - **No action Required**
The 1.6.0 milestone is at 82% completion
https://gitlab.com/foundryadvancement consumptionnow that I brought that up on #progress-reports @calego , could I maybe pester you later for some adAlternative Alignment System D&D5eWow, that is a really powerful way to codify alignment. I like it! Do you have any ideas as to how iconsumables chat data@Zhell
> So that's odd. How come consumables work different and all other item types get a non-funcilthid stop dragActually, would it be possible to modify the core function that allows people to click and drag toke1.6.x mid-milestone update@dnd5e - **No Action Required**
Milestone 1.6.0 is 69% Complete (_nice_)
<https://gitlab.com/foundPlugin ContributorsI'm very proud to be the maintainer of a module (Export Sheet to PDF) that is getting many, many conmore-hooks-itemroll-hooksFor those of you interested in such things, I have hacked together a way to inject hooks into the mipreHooks5eJSON.stringify jankI discovered that the problem is JSON.stringify, not parselayersTIL about CSS Layers.
https://developer.mozilla.org/en-US/docs/Web/CSS/@layer
```css
@layer utilitiHitDice hooks MRI just added my first merge request 😄 <https://gitlab.com/foundrynet/dnd5e/-/merge_requests/495>advantage shennanegins