Something went wrong. Try again.
Browser extension: detect and subscribe to standard.site publications on ATProto
Something went wrong. Try again.
772 B · 22 lines
TypeScript
1234567891011121314151617181920212223// Moved from feedback.test.ts with isScopeError itself: the labeler list now// asks the same question about a read that the feedback form asks about a// write.
import { describe, expect, it } from 'vitest'import { isScopeError } from './scope'
describe('isScopeError', () => { it('recognizes the PDS refusing a write the grant does not cover', () => { expect(isScopeError({ error: 'ScopeMissingError', message: 'Missing required scope' })).toBe( true, ) expect(isScopeError(new Error('Missing required scope "repo:app.userinput.discussion"'))).toBe( true, ) })
it('leaves every other failure alone', () => { expect(isScopeError(new Error('Failed to fetch'))).toBe(false) expect(isScopeError(undefined)).toBe(false) })})