feat(classes.ghost): Add members, settings and webhooks support; implement Member class and add tests
This commit is contained in:
28
test/test.ghost.node.ts
Normal file
28
test/test.ghost.node.ts
Normal 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 };
|
Reference in New Issue
Block a user