wip - claude --resume 742969c2-ab50-4a79-b7bd-3971e9fd314d

This commit is contained in:
Samuel Newman
2026-05-15 21:58:48 +03:00
parent f04b350f05
commit 1c60734e84
40 changed files with 1209 additions and 1571 deletions
+2
View File
@@ -1,3 +1,5 @@
import {describe, expect, it} from 'vitest'
import {bundleAsync} from '../../../src/lib/async/bundle'
describe('bundle', () => {
+1 -1
View File
@@ -1,4 +1,4 @@
import {describe, expect, it} from '@jest/globals'
import {describe, expect, it} from 'vitest'
import tldts from 'tldts'
import {isEmailMaybeInvalid} from '#/lib/strings/email'
+2
View File
@@ -1,3 +1,5 @@
import {describe, expect, it} from 'vitest'
import {isNetworkError} from '../../src/lib/strings/errors'
describe('isNetworkError', () => {
+6 -5
View File
@@ -1,5 +1,6 @@
import {createDownloadResumable, deleteAsync} from 'expo-file-system/legacy'
import {manipulateAsync, SaveFormat} from 'expo-image-manipulator'
import {afterEach, beforeEach, describe, expect, it, type Mock, vi} from 'vitest'
import {
downloadAndResize,
@@ -16,10 +17,10 @@ const mockResizedImage = {
}
describe('downloadAndResize', () => {
const errorSpy = jest.spyOn(global.console, 'error')
const errorSpy = vi.spyOn(global.console, 'error')
beforeEach(() => {
const mockedCreateResizedImage = manipulateAsync as jest.Mock
const mockedCreateResizedImage = manipulateAsync as Mock
mockedCreateResizedImage.mockResolvedValue({
uri: 'file://resized-image.jpg',
...mockResizedImage,
@@ -27,13 +28,13 @@ describe('downloadAndResize', () => {
})
afterEach(() => {
jest.clearAllMocks()
vi.clearAllMocks()
})
it('should return resized image for valid URI and options', async () => {
const mockedFetch = createDownloadResumable as jest.Mock
const mockedFetch = createDownloadResumable as Mock
mockedFetch.mockReturnValue({
cancelAsync: jest.fn(),
cancelAsync: vi.fn(),
downloadAsync: jest
.fn()
.mockResolvedValue({uri: 'file://resized-image.jpg'}),
+2
View File
@@ -1,3 +1,5 @@
import {describe, expect, it} from 'vitest'
import {getLikelyType, LikelyType} from '../../src/lib/link-meta/link-meta'
describe('getLikelyType', () => {
+2
View File
@@ -1,3 +1,5 @@
import {describe, expect, it} from 'vitest'
import {clamp} from '../../src/lib/numbers'
describe('clamp', () => {
+1
View File
@@ -1,5 +1,6 @@
import {RichText} from '@atproto/api'
import {i18n} from '@lingui/core'
import {describe, expect, it} from 'vitest'
import {parseEmbedPlayerFromUrl} from '#/lib/strings/embed-player'
import {
+2
View File
@@ -1,3 +1,5 @@
import {describe, expect, it} from 'vitest'
import {type IsValidHandle, validateServiceHandle} from '#/lib/strings/handles'
describe('handle validation', () => {
@@ -1,3 +1,5 @@
import {describe, expect, it} from 'vitest'
import {
getMentionAt,
insertMentionAt,
+1 -1
View File
@@ -1,4 +1,4 @@
import {describe, expect, it} from '@jest/globals'
import {describe, expect, it} from 'vitest'
import {
isPossiblyAUrl,