-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
You can definitely include |
the only viable way i'd see testing this in a production like env is keyring setting up basically everything from scratch which would take more time than what the fix should be accomplished I would merge this a HOT-fix to check the reproduction, it doesn't do then a revert back pretty much won't break any other stuff, i recall originally pavlovcik asked a core dev to have a test env for similar situations but not sure if it was built |
} | ||
|
||
expect(wordScoreCommentDetails).toEqual({ | ||
was: new Decimal(0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make sense to me. was
is not a built in property so why is it's count 0 if it's in your test array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the in the test I've simplified the logic down to the core issue and removed all of the actual scoring, so it's set as zero by default. All of the built-ins are removed from the array of words
const counter = wordScoreCommentDetails[word] || ZERO;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand but based on the non test code changes, and moleculas recommendation I can merge this pull
counter = counter.plus(this.roleWordScore); | ||
wordScoreCommentDetails[word] = counter; | ||
if (!builtIns.has(word)) { | ||
let counter = wordScoreCommentDetails[word] || ZERO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZERO
it's still constructed as a Decimal, can you perhaps so it's expect a decimal in the end, can you perhaps type let counter: Decimal
and test as such?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good observation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const counter: Decimal
It's already inferred as such without being explicit but the test still passes either way, I have just tried locally but with the PR being closed it's a dud.
Proved to be working via rpc-handler anyway happy days
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps for a future improved, pavlovick is one of the like loves everything Typed
!
Resolves #31
QA: