mirror of
https://github.com/immich-app/immich.git
synced 2026-02-10 19:07:55 +03:00
* fix: don't allow floating promises * fix: await all promises * fix: download archives * fix cli tests * fix: skip web
25 lines
616 B
TypeScript
25 lines
616 B
TypeScript
import { UploadService } from './upload.service';
|
|
import axios from 'axios';
|
|
import FormData from 'form-data';
|
|
import { ApiConfiguration } from '../cores/api-configuration';
|
|
|
|
jest.mock('axios', () => jest.fn());
|
|
|
|
describe('UploadService', () => {
|
|
let uploadService: UploadService;
|
|
|
|
beforeEach(() => {
|
|
const apiConfiguration = new ApiConfiguration('https://example.com/api', 'key');
|
|
|
|
uploadService = new UploadService(apiConfiguration);
|
|
});
|
|
|
|
it('should call axios', async () => {
|
|
const data = new FormData();
|
|
|
|
await uploadService.upload(data);
|
|
|
|
expect(axios).toHaveBeenCalled();
|
|
});
|
|
});
|