Skip to content

Instantly share code, notes, and snippets.

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
; --------------------------------------------------------------
; NOTES
; --------------------------------------------------------------
; ! = ALT
; ^ = CTRL
const crypto = require('crypto')
describe('Predictable Randomness', () => {
describe('Math.random', () => {
const firstResult = 0.37454011430963874
const secondResult = 0.7965429842006415
beforeEach(() => Math.__clearChances__())
it('should produce these two numbers first by default', () => {
expect(Math.random()).toEqual(firstResult)
expect(Math.random()).toEqual(secondResult)