feat(classes.ghost): Add members, settings and webhooks support; implement Member class and add tests

This commit is contained in:
2025-10-07 14:29:36 +00:00
parent cf10f51089
commit 76c2b714b5
15 changed files with 1173 additions and 4 deletions

28
test/test.ghost.node.ts Normal file
View File

@@ -0,0 +1,28 @@
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 };