generated from hyper63/adapter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(atlas-data): document as experimental and not fully implemen…
…ted #36
- Loading branch information
1 parent
531f277
commit c24d63a
Showing
5 changed files
with
35 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { assertEquals, assertObjectMatch, assertThrows, deferred } from '../dev_deps.ts' | ||
|
||
import { AtlasClient } from './atlas.ts' | ||
import { AtlasDataClient } from './atlas-data.ts' | ||
|
||
Deno.test('client - atlas', async (t) => { | ||
Deno.test('client - atlas-data', async (t) => { | ||
let fetchMock = deferred<{ url: string; init: RequestInit }>() | ||
|
||
const happy = { | ||
|
@@ -21,7 +21,7 @@ Deno.test('client - atlas', async (t) => { | |
} | ||
|
||
await t.step('should append the method to the url', async () => { | ||
const client = new AtlasClient(happy) | ||
const client = new AtlasDataClient(happy) | ||
fetchMock = deferred<{ url: string; init: RequestInit }>() | ||
|
||
await client | ||
|
@@ -39,7 +39,7 @@ Deno.test('client - atlas', async (t) => { | |
|
||
await t.step('should append the headers to the request', async (t) => { | ||
await t.step('Content-Type and Accept', async () => { | ||
const client = new AtlasClient(happy) | ||
const client = new AtlasDataClient(happy) | ||
fetchMock = deferred<{ url: string; init: RequestInit }>() | ||
|
||
await client | ||
|
@@ -56,7 +56,7 @@ Deno.test('client - atlas', async (t) => { | |
|
||
await t.step('auth', async (t) => { | ||
await t.step('api-key', async () => { | ||
const client = new AtlasClient(happy) | ||
const client = new AtlasDataClient(happy) | ||
fetchMock = deferred<{ url: string; init: RequestInit }>() | ||
|
||
await client | ||
|
@@ -71,7 +71,7 @@ Deno.test('client - atlas', async (t) => { | |
}) | ||
|
||
await t.step('jwtTokenString', async () => { | ||
const client = new AtlasClient({ | ||
const client = new AtlasDataClient({ | ||
...happy, | ||
auth: { jwtTokenString: 'foobar' }, | ||
}) | ||
|
@@ -89,7 +89,7 @@ Deno.test('client - atlas', async (t) => { | |
}) | ||
|
||
await t.step('email and password', async () => { | ||
const client = new AtlasClient({ | ||
const client = new AtlasDataClient({ | ||
...happy, | ||
auth: { email: '[email protected]', password: 'secret' }, | ||
}) | ||
|
@@ -111,7 +111,7 @@ Deno.test('client - atlas', async (t) => { | |
|
||
await t.step('should append the body to the request', async (t) => { | ||
await t.step('database, collection, and dataSource', async () => { | ||
const client = new AtlasClient(happy) | ||
const client = new AtlasDataClient(happy) | ||
fetchMock = deferred<{ url: string; init: RequestInit }>() | ||
|
||
await client | ||
|
@@ -129,7 +129,7 @@ Deno.test('client - atlas', async (t) => { | |
}) | ||
|
||
await t.step('options', async () => { | ||
const client = new AtlasClient(happy) | ||
const client = new AtlasDataClient(happy) | ||
fetchMock = deferred<{ url: string; init: RequestInit }>() | ||
|
||
await client | ||
|
@@ -149,6 +149,6 @@ Deno.test('client - atlas', async (t) => { | |
await t.step('should throw if credentials are not provided', () => { | ||
// deno-lint-ignore ban-ts-comment | ||
// @ts-expect-error | ||
assertThrows(() => new AtlasClient({ ...happy, auth: {} })) | ||
assertThrows(() => new AtlasDataClient({ ...happy, auth: {} })) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters