Files
ghost/test/test.ghost.node+deno.ts

29 lines
944 B
TypeScript
Raw Permalink Normal View History

import { expect, tap } from '@push.rocks/tapbundle';
import * as qenv from '@push.rocks/qenv';
const testQenv = new qenv.Qenv('./', './.nogit/');
import * as ghost from '../ts/index.js';
let testGhostInstance: ghost.Ghost;
tap.test('should create a valid instance of Ghost', async () => {
testGhostInstance = new ghost.Ghost({
baseUrl: 'http://localhost:2368',
adminApiKey: await testQenv.getEnvVarOnDemand('ADMIN_APIKEY'),
contentApiKey: await testQenv.getEnvVarOnDemand('CONTENT_APIKEY'),
});
expect(testGhostInstance).toBeInstanceOf(ghost.Ghost);
expect(testGhostInstance.options.baseUrl).toEqual('http://localhost:2368');
});
tap.test('should have adminApi configured', async () => {
expect(testGhostInstance.adminApi).toBeTruthy();
});
tap.test('should have contentApi configured', async () => {
expect(testGhostInstance.contentApi).toBeTruthy();
});
export default tap.start();
export { testGhostInstance };