feat: add build

This commit is contained in:
Morten Olsen
2025-10-16 22:07:56 +02:00
parent 11828da073
commit 2ea453ea2f
19 changed files with 267 additions and 23 deletions

View File

@@ -39,6 +39,7 @@ describe('mqtt', () => {
it('should not be able to publish if not allowed', async () => {
const [client] = await world.connect([]);
// eslint-disable-next-line
const promise = client.publishAsync('test', 'test');
// TODO: why does this not throw?

View File

@@ -1,4 +1,4 @@
import type { Statement } from '#root/access/access.schemas.ts';
import type { Statement } from '#root/auth/auth.schemas.ts';
const statements = {
all: [

View File

@@ -33,6 +33,16 @@ const createWorld = async (options: WorldOptions) => {
backbone.services.set(Config, {
jwtSecret: 'test',
adminToken: 'test',
api: {
enabled: true,
},
ws: {
enabled: true,
},
tcp: {
enabled: false,
port: 1883,
},
});
const accessTokens = backbone.services.get(JwtAuth);
backbone.sessionProvider.register('token', accessTokens);
@@ -61,7 +71,7 @@ const createWorld = async (options: WorldOptions) => {
},
destroy: async () => {
await Promise.all(sockets.map((s) => s.endAsync()));
await fastify.close();
await backbone.destroy();
},
};
};