Skip to content

Commit cfc8f15

Browse files
Create basic example spec
1 parent ac56f19 commit cfc8f15

5 files changed

Lines changed: 48 additions & 0 deletions

File tree

test/spec/basic/server.spec.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import 'jasmine';
2+
3+
import { pointy } from '../../../src/';
4+
import { forkServer } from '../../../src/fork-server';
5+
const ROOT_PATH = require('app-root-path').toString();
6+
7+
const http = pointy.http;
8+
9+
let serverfork;
10+
11+
beforeAll(async () => {
12+
serverfork = await forkServer('./lib/test/examples/basic/server.js');
13+
14+
// Database
15+
await pointy.db
16+
.connect(ROOT_PATH)
17+
.catch((error) =>
18+
fail('Cannot start database' + JSON.stringify(error))
19+
);
20+
});
21+
22+
afterAll(() => {
23+
if (serverfork) {
24+
serverfork.kill();
25+
}
26+
});
27+
28+
describe('API Server', () => {
29+
it('is running', async () => {
30+
await http.get('/', {}, [ 200, 404 ]).catch((error) => fail(error));
31+
});
32+
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { pointy } from '../../../../src';
2+
const http = pointy.http;
3+
4+
describe('User API Delete', () => {});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { pointy } from '../../../../src';
2+
const http = pointy.http;
3+
4+
describe('User API Read', () => {});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { pointy } from '../../../../src';
2+
const http = pointy.http;
3+
4+
describe('User API Create', () => {});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { pointy } from '../../../../src';
2+
const http = pointy.http;
3+
4+
describe('User API Update', () => {});

0 commit comments

Comments
 (0)