You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent result of bun test in Local MacOS and GitHub Actions Ubuntu #7386
library/src/utils/num-in-words-factory.test.ts:
(pass) numInWordsFactory > should return a functionwhen called [0.04ms]
Error: Expected []
at /home/runner/work/i18n-num-in-words/i18n-num-in-words/library/src/utils/num-in-words-factory.test.ts:49:4
44 | const fn = (num: number) =>`one`;
45 | const factory = numInWordsFactory(fn, { lang });
46 |
47 | factory(1, { experimental: true });
48 |
49 |expect(warnSpy).toHaveBeenCalled();
^
error: expect(received).toHaveBeenCalled()
Expected []
at /home/runner/work/i18n-num-in-words/i18n-num-in-words/library/src/utils/num-in-words-factory.test.ts:49:4
(fail) numInWordsFactory > should warn when experimental is true [0.21ms]
The fn (en) feature is not stable yet. Please enable the experimental flag to use it.
(pass) numInWordsFactory > should handle experimental false and non-stable status [0.11ms]
(pass) numInWordsFactory > should handle experimental false and stable status [0.06ms]
The fn (en) feature is not stable yet. Please enable the experimental flag to use it.
(pass) numInWordsFactory > should handle experimental false and default status [0.06ms]
The fn (en) feature is not stable yet. Please enable the experimental flag to use it.
(pass) numInWordsFactory > should return an error when experimental false and non-stable status [0.06ms]
The number 9007199254740992 is too large to be converted.
(pass) numInWordsFactory > should handle large numbers [0.05ms]
Error: Expected []
at /home/runner/work/i18n-num-in-words/i18n-num-in-words/library/src/utils/num-in-words-factory.test.ts:135:4
130 |
131 | // Call the factory again with the same number
132 | res = factory(staticNum);
133 |
134 | expect(res).toBe(staticWord);
135 | expect(fn).toHaveBeenCalledTimes(1);
^
error: expect(received).toHaveBeenCalledTimes(expected)
Expected []
at /home/runner/work/i18n-num-in-words/i18n-num-in-words/library/src/utils/num-in-words-factory.test.ts:135:4
(fail) numInWordsFactory > should handle memoization [0.13ms]
(pass) numInWordsFactory > should handle debug mode [0.13ms]
Error: Expected []
at /home/runner/work/i18n-num-in-words/i18n-num-in-words/library/src/utils/num-in-words-factory.test.ts:158:4
153 |
154 | // Call the factory twice with the same number
155 | factory(staticNum, { debug: true });
156 | factory(staticNum, { debug: true });
157 |
158 | expect(fn).toHaveBeenCalledTimes(1);
^
error: expect(received).toHaveBeenCalledTimes(expected)
Expected []
at /home/runner/work/i18n-num-in-words/i18n-num-in-words/library/src/utils/num-in-words-factory.test.ts:158:4
@simylein I'm not doing anything near that, it's just a library to change integer numbers into internationalized strings.
Previous version of bun having consistent result as Node.js and Jest result tho.
Kudos to @oven-sh, the test is always blazingly fast.
Activity
Jarred-Sumner commentedon Dec 1, 2023
i have a feeling this is going to be an Intl library thing but i haven't read the code
simylein commentedon Dec 1, 2023
If your library happens to do any kind of file reading the sorting will be different on Linux to macOS
ImBIOS commentedon Dec 1, 2023
@simylein I'm not doing anything near that, it's just a library to change integer numbers into internationalized strings.
Previous version of bun having consistent result as Node.js and Jest result tho.
Kudos to @oven-sh, the test is always blazingly fast.
josh- commentedon Mar 19, 2025
Also running into this - could it be related to differences in the ICU library between macOS and Ubuntu?
For example, consider this code:
on macOS this is
Apr 2024 at 10:00however on Ubuntu (GitHub Actions) this isApr 2024, 00:00(note,instead ofat)in both places
Intl.DateTimeFormat().resolvedOptions().localeresolves toen-US.when testing the browsers I have installed on my macOS machine, Safari returns
Apr 2024 at 10:00and Chrome returnsApr 2024, 10:00.bun testResult / Succes Locally (Linux), Error in GitHub Action (Linux) #9764 as a duplicate of this issue