29 lines
944 B
TypeScript
29 lines
944 B
TypeScript
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 };
|