deno.land / x / feathers@v5.0.0-pre.29 / test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { assertEquals } from 'https://deno.land/std@0.91.0/testing/asserts.ts';import { feathers } from './mod.ts';
class MyService { async create (data: any) { return data; }}
Deno.test('instantiates a Feathers app with a service', async () => { const app = feathers(); const data = { message: 'hi' };
app.use('test', new MyService());
const eventPromise = new Promise(resolve => { app.service('test').once('created', (data: any) => resolve(data)); }); assertEquals(await app.service('test').create(data), data); assertEquals(await eventPromise, data);});
feathers
The API and real-time application framework
DocumentationDocumentation
GitHub Repositoryfeathersjs/feathers
GitHub Stars
14209

Version Info

Tagged at
2 months ago

External Dependencies

2 external dependencies