Update docs
This commit is contained in:
@@ -1,28 +1,11 @@
|
||||
import { describe, it, expect, afterEach } from 'vitest'
|
||||
import { basePathFrom, byteBudget, filenamePrefix, maxFileSize, notifyConfig } from '../src/config'
|
||||
import { byteBudget, filenamePrefix, maxFileSize, notifyConfig } from '../src/config'
|
||||
import { resetConfig, setConfig } from './helpers'
|
||||
|
||||
afterEach(resetConfig)
|
||||
|
||||
const MB = 1024 * 1024
|
||||
|
||||
describe('basePathFrom', () => {
|
||||
it('is empty for an own-hostname deployment', () => {
|
||||
expect(basePathFrom('https://upload.example.com')).toBe('')
|
||||
expect(basePathFrom('https://upload.example.com/')).toBe('')
|
||||
expect(basePathFrom(undefined)).toBe('')
|
||||
})
|
||||
|
||||
it('is the URL path for a path-prefix deployment, without a trailing slash', () => {
|
||||
expect(basePathFrom('https://photos.example.com/upload')).toBe('/upload')
|
||||
expect(basePathFrom('https://photos.example.com/a/b/')).toBe('/a/b')
|
||||
})
|
||||
|
||||
it('is empty for a value that is not a URL', () => {
|
||||
expect(basePathFrom('not a url')).toBe('')
|
||||
})
|
||||
})
|
||||
|
||||
describe('upload options', () => {
|
||||
it('has the documented defaults', () => {
|
||||
expect(maxFileSize()).toBe(500 * MB)
|
||||
|
||||
Reference in New Issue
Block a user