Skip to content

Commit 5f62d9f

Browse files
committed
fix: tests use updated names
1 parent f023519 commit 5f62d9f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

test/MockServerController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MockServerController {
2828
*/
2929
res.send({
3030
success: true,
31-
basePath: mockServer.basePath,
31+
endpointUrl: mockServer.basePath,
3232
accessToken: process.env.MOCK_PINNING_SERVER_SECRET
3333
})
3434
} catch (error) {

test/client.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
/* eslint-env browser, node, mocha */
22

33
import { expect } from 'aegir/utils/chai'
4-
import { Configuration, PinsApi, Status } from '../src'
4+
import { Configuration, RemotePinningServiceClient, Status } from '../src'
55
import type { Pin } from '../src'
66
import fetchPonyfill from 'fetch-ponyfill'
77

88
const { fetch } = fetchPonyfill()
99

1010
let Config = new Configuration({
11-
basePath: 'http://127.0.0.1:3000',
11+
endpointUrl: 'http://127.0.0.1:3000',
1212
// fetchApi: fetch,
1313
accessToken: process.env.MOCK_PINNING_SERVER_SECRET
1414
})
1515
describe('Client', () => {
1616
it('Can be instantiated', () => {
17-
expect(() => new PinsApi(Config)).not.to.throw()
17+
expect(() => new RemotePinningServiceClient(Config)).not.to.throw()
1818
})
1919

2020
describe('Operations', () => {
2121
// let mockServer: MockServer
2222
// let Config: Configuration
2323
beforeEach(async () => {
2424
const response = await fetch('http://localhost:3000/start')
25-
const { basePath, accessToken } = await response.json()
25+
const { endpointUrl, accessToken } = await response.json()
2626
Config = new Configuration({
27-
basePath,
27+
endpointUrl,
2828
accessToken
2929
// fetchApi: fetch
3030
})
@@ -42,13 +42,13 @@ describe('Client', () => {
4242
})
4343

4444
it('GET: Can get failed Pins', async () => {
45-
const Client = new PinsApi(Config)
45+
const Client = new RemotePinningServiceClient(Config)
4646
const response = await Client.pinsGet({ limit: 1, status: new Set([Status.Failed]) })
4747
expect(response).to.deep.eq({ count: 0, results: new Set() })
4848
})
4949

5050
it('GET: Can add a Pin successfully', async () => {
51-
const Client = new PinsApi(Config)
51+
const Client = new RemotePinningServiceClient(Config)
5252
const pin: Pin = {
5353
cid: 'abc123',
5454
name: 'pinned-test1'
@@ -59,7 +59,7 @@ describe('Client', () => {
5959
})
6060

6161
it('POST: Can handle a failed pinning', async () => {
62-
const Client = new PinsApi(Config)
62+
const Client = new RemotePinningServiceClient(Config)
6363
const pin: Pin = {
6464
cid: 'abc123',
6565
name: 'failed-test2'

0 commit comments

Comments
 (0)