Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Refactor: replace test suite with vitest #2328

Draft
wants to merge 4 commits into
base: build/cleanup-dependencies
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: update create update test
  • Loading branch information
axe312ger committed Jun 27, 2024
commit 05a7550960e90bef3fd2ccb1a1bf01634add6049
37 changes: 0 additions & 37 deletions test/unit/create-adapter-test.js

This file was deleted.

22 changes: 22 additions & 0 deletions test/unit/create-adapter.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { describe, it, expect } from 'vitest'
import { RestAdapter, RestAdapterParams } from '../../lib/adapters/REST/rest-adapter'
import { createAdapter } from '../../lib/create-adapter'

describe('createAdapter', () => {
it('returns adapter if provided', () => {
const apiAdapter = new RestAdapter({ accessToken: 'token' } as RestAdapterParams)

const createdAdapter = createAdapter({
apiAdapter,
})

expect(createdAdapter).toBe(apiAdapter)
})

describe('creates RestAdapter', () => {
it('if no apiAdapter is provided', () => {
const createdAdapter = createAdapter({ accessToken: 'token' })
expect(createdAdapter).toBeInstanceOf(RestAdapter)
})
})
})