Rocky_Mountain_Vending/.pnpm-store/v10/files/3e/88c8ced2a1eb594806bf84e571318a7ad90098c4b313b43a0fab71637241f3708578e6321540443f5ab0d8dbbf1784543b04bcf2bbd71f647f03dd5d6c395b
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

51 lines
1.2 KiB
Text

import { afterEach, beforeEach } from "./test/vitest";
import { addLeadingZeros } from "./addLeadingZeros.js";
import { setDefaultOptions } from "./defaultOptions.js";
import sinon from "./test/sinon";
export function assertType(_value) {}
export function resetDefaultOptions() {
setDefaultOptions({});
}
// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
export function generateOffset(originalDate) {
// Add the timezone.
let offset = "";
const tzOffset = originalDate.getTimezoneOffset();
if (tzOffset !== 0) {
const absoluteOffset = Math.abs(tzOffset);
const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
// If less than 0, the sign is +, because it is ahead of time.
const sign = tzOffset < 0 ? "+" : "-";
offset = `${sign}${hourOffset}:${minuteOffset}`;
} else {
offset = "Z";
}
return offset;
}
export function fakeDate(date) {
let clock;
function fakeNow(date) {
clock?.restore();
clock = sinon.useFakeTimers(+date);
}
beforeEach(() => {
fakeNow(+date);
});
afterEach(() => {
clock?.restore();
clock = undefined;
});
return { fakeNow };
}