Something went wrong. Try again.
Client side atproto account migrator in your web browser, along with services for backups and adversarial migrations. pdsmoover.com
pds atproto migrations moo cow
Something went wrong. Try again.
1.2 kB · 32 lines
TypeScript
at main
123456789101112131415161718192021222324252627282930313233import { describe, expect, it } from 'vitest'import { isErrorReportingOff } from './errorReporting'
describe('isErrorReportingOff', () => { it('is false without a cookie header', () => { expect(isErrorReportingOff(undefined)).toBe(false) expect(isErrorReportingOff(null)).toBe(false) expect(isErrorReportingOff('')).toBe(false) })
it('is false when the cookie is absent', () => { expect(isErrorReportingOff('a=1; b=2')).toBe(false) })
it('is true when the cookie is off', () => { expect(isErrorReportingOff('pdsmoover_error_reporting=off')).toBe(true) })
it('is false when the cookie has another value', () => { expect(isErrorReportingOff('pdsmoover_error_reporting=on')).toBe(false) expect(isErrorReportingOff('pdsmoover_error_reporting=offline')).toBe(false) })
it('finds the cookie among others, with spaces', () => { expect(isErrorReportingOff('a=1; pdsmoover_error_reporting=off ; b=2')).toBe(true) })
it('does not match a cookie whose name only ends with ours', () => { expect(isErrorReportingOff('xpdsmoover_error_reporting=off')).toBe(false) expect(isErrorReportingOff('a=1; xpdsmoover_error_reporting=off')).toBe(false) })})