@uppy/companion-client
Version:
Client library for communication with Companion. Intended for use in Uppy plugins.
22 lines (19 loc) • 653 B
text/typescript
import { describe, it, expect } from 'vitest'
import RequestClient from './RequestClient.js'
describe('RequestClient', () => {
it('has a hostname without trailing slash', () => {
const mockCore = { getState: () => ({}) } as any
const a = new RequestClient(mockCore, {
pluginId: 'test',
provider: 'test',
companionUrl: 'http://companion.uppy.io',
})
const b = new RequestClient(mockCore, {
pluginId: 'test2',
provider: 'test2',
companionUrl: 'http://companion.uppy.io/',
})
expect(a.hostname).toBe('http://companion.uppy.io')
expect(b.hostname).toBe('http://companion.uppy.io')
})
})