index.test.ts 992 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { describe, expect, it } from 'vitest'
  2. import Core from '@uppy/core'
  3. import Tus from './index.ts'
  4. describe('Tus', () => {
  5. it('Throws errors if autoRetry option is true', () => {
  6. const uppy = new Core()
  7. expect(() => {
  8. // @ts-expect-error removed
  9. uppy.use(Tus, { autoRetry: true })
  10. }).toThrowError(
  11. /The `autoRetry` option was deprecated and has been removed/,
  12. )
  13. })
  14. it('Throws errors if autoRetry option is false', () => {
  15. const uppy = new Core()
  16. expect(() => {
  17. // @ts-expect-error removed
  18. uppy.use(Tus, { autoRetry: false })
  19. }).toThrowError(
  20. /The `autoRetry` option was deprecated and has been removed/,
  21. )
  22. })
  23. it('Throws errors if autoRetry option is `undefined`', () => {
  24. const uppy = new Core()
  25. expect(() => {
  26. // @ts-expect-error removed
  27. uppy.use(Tus, { autoRetry: undefined })
  28. }).toThrowError(
  29. /The `autoRetry` option was deprecated and has been removed/,
  30. )
  31. })
  32. })