Skip to content

Commit

Permalink
fix: some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele committed Jan 4, 2025
1 parent 5738972 commit d840e49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const MockTeleportCommand = new CommandOutputDTO({
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
functionId: randomUUID(),
moduleId: randomUUID(),
versionId: randomUUID(),
domain: 'mock domain',
name: 'settele',
trigger: 'settele',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const tests = [
).data.data;
await this.client.hook.hookControllerCreate({
name: 'Test hook 1',
moduleId: mod.id,
versionId: mod.latestVersion.id,
regex: 'test msg',
eventType: 'chat-message',
function: `import { data, takaro } from '@takaro/helpers';
Expand All @@ -147,7 +147,10 @@ const tests = [
await main();`,
});

await this.client.gameserver.gameServerControllerInstallModule(this.setupData.gameserver.id, mod.id);
await this.client.module.moduleInstallationsControllerInstallModule({
gameServerId: this.setupData.gameserver.id,
versionId: mod.latestVersion.id,
});

const listener = (await new EventsAwaiter().connect(this.client)).waitForEvents(HookEvents.HOOK_EXECUTED, 1);

Expand Down Expand Up @@ -280,7 +283,6 @@ const tests = [
playerId: this.setupData.players[0].id,
});

console.log(JSON.stringify((await events)[0].data.meta.result, null, 2));
const result = (await events)[0].data.meta.result;
expect(result.success).to.be.false;
expect(result.reason).to.include('SyntaxError: Unexpected end of input.');
Expand Down

0 comments on commit d840e49

Please sign in to comment.