-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into feat/220-unique-values
- Loading branch information
Showing
9 changed files
with
81 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as falso from '../theme/ReactLiveScope/falso.min'; | ||
|
||
if (typeof window !== 'undefined') { | ||
window.onload = function () { | ||
const titleStyles = 'color:#8a76d9; font-size: 22px; font-weight:bold;'; | ||
const copyStyles = 'color:white; font-size: 14px'; | ||
const exampleStyles = 'color:#8a76d9; font-size: 14px;'; | ||
console.log('%cFalso\n\n' + '%cYou can use _ to access Falso functions here in the console. \n\n%c' + 'For example: _.randFullName()', titleStyles, copyStyles, exampleStyles) | ||
|
||
window._ = falso; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { randNumber } from '../lib/number'; | ||
|
||
describe('randNumber', () => { | ||
it('should return a random number', () => { | ||
const [min, max] = [1, 999_999]; | ||
const num = randNumber({ min, max }); | ||
expect(typeof num).toBe('number'); | ||
expect(num).toBeGreaterThanOrEqual(min); | ||
expect(num).toBeLessThanOrEqual(max); | ||
}); | ||
|
||
it('should support precision', () => { | ||
const num = randNumber({ min: 1000, max: 2000, precision: 100 }); | ||
expect(typeof num).toBe('number'); | ||
expect(String(num)).toMatch(/^\d\d00$/); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters