is-is-odd icon indicating copy to clipboard operation
is-is-odd copied to clipboard

Fix #4

Open Alexiscomete opened this issue 3 years ago • 23 comments

fix #4

Alexiscomete avatar Nov 19 '21 17:11 Alexiscomete

Thanks for the PR! Gave it a quick glimpse and I have so many questions. I'll try to review in the weekend.

slmjkdbtl avatar Nov 19 '21 20:11 slmjkdbtl

Code looks good. I'll write some unit tests just to make sure this doesn't happen in the future

anematode avatar Nov 29 '21 17:11 anematode

The code looks alright. Can you test it with the new test in #6 ?

slmjkdbtl avatar Nov 29 '21 20:11 slmjkdbtl

I'm a production user of this library and this will break everything.

For example, in the following test --

window.isOdd = require('is-odd');

function monkeyPatch(key, fakedValue) { window[key] = fakedValue }

monkeyPatch('isOdd', false) // don't really call isOdd in tests

it('supports monkeypatching isOdd to false', () => {
   expects(isIsOdd(window.isOdd)).toBe(true) // FAILING BEHAVIOR NOW - THANKS FOR NOTHING
})

Please consider how your actions effect others, this patch has ruined most of my week.

leewardbound avatar Dec 02 '21 22:12 leewardbound

@leewardbound I'm a bit confused by this usage. The monkey patched isOdd is indeed not isOdd, why should it return true?

Also, why would anyone monkey patch isOdd? Is there a function or any value of more significance (besides isIsOdd)?

slmjkdbtl avatar Dec 02 '21 23:12 slmjkdbtl

I fix something sometime ago to resolve the debate

Alexiscomete avatar Feb 09 '22 12:02 Alexiscomete

+1

victorbnl avatar May 15 '22 17:05 victorbnl

😥

Alexiscomete avatar May 15 '22 17:05 Alexiscomete

:octocat:

Alexiscomete avatar May 15 '22 17:05 Alexiscomete

+1

Badr-T avatar Jun 10 '22 09:06 Badr-T

+2

Alexiscomete avatar Jun 10 '22 09:06 Alexiscomete

What is the best that you ever played ?

Alexiscomete avatar Jun 11 '22 15:06 Alexiscomete

Yes

victorbnl avatar Jun 12 '22 12:06 victorbnl

What is this game @victorbnl ? I never heard about it

Alexiscomete avatar Jun 12 '22 12:06 Alexiscomete

Yes

victorbnl avatar Jun 12 '22 13:06 victorbnl

...

Alexiscomete avatar Jun 12 '22 13:06 Alexiscomete

Yes

Alexiscomete avatar Jun 12 '22 13:06 Alexiscomete

Positive or negative, I only want an answer.

Alexiscomete avatar Jun 12 '22 14:06 Alexiscomete

Yes

victorbnl avatar Jun 12 '22 15:06 victorbnl

Yes

Alexiscomete avatar Jun 13 '22 11:06 Alexiscomete