mirror of
https://github.com/directus/directus.git
synced 2026-02-17 07:11:41 -05:00
* add new sdk * update version * fixes and sdk documentation * typing updates, documentation * added missing endpoints * targeting minified version for unpkg * removed unused types file * fixed non minified versions * fix sdk exports * fix the fix * Remove old sdk * Remove old sdk docs * Install types for Jest, add npm test * Rely on npm exclusively * Remove examples folder * Move typescript down * Update sdk.md * added auto refresh and requested changes added more http test calls fixed typing issue in customized types * remove unused endpoint * updated docs * added singletons, fixed typing issues, added password handlers * rename graphql function and fixed system endpoint * Remove unused imports, fix build Co-authored-by: rijkvanzanten <rijkvanzanten@me.com> Co-authored-by: Ben Haynes <ben@rngr.org>
27 lines
604 B
TypeScript
27 lines
604 B
TypeScript
/**
|
|
* @jest-environment node
|
|
*/
|
|
|
|
import { Directus } from '../../src';
|
|
import { test } from '../utils';
|
|
|
|
describe('server', function () {
|
|
test(`ping the server`, async (url, nock) => {
|
|
nock().get('/server/ping').reply(200, 'pong', { 'Content-Type': 'text/plain' });
|
|
|
|
const sdk = new Directus(url);
|
|
const str = await sdk.server.ping();
|
|
|
|
expect(str).toBe('pong');
|
|
});
|
|
|
|
test(`get server info`, async (url, nock) => {
|
|
const scope = nock().get('/server/info').reply(200, {});
|
|
|
|
const sdk = new Directus(url);
|
|
await sdk.server.info();
|
|
|
|
expect(scope.pendingMocks().length).toBe(0);
|
|
});
|
|
});
|