Skip to content

Commit

Permalink
Fix some errors in ban service (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele authored Aug 18, 2020
1 parent df48469 commit a7f5528
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/ban/ban.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class BanService {
// Blocked by https://github.com/nestjsx/@nestjs/bull/pull/166
await this.processProfile(player, banStatusForUser);
} else {
return this.logger.warn(
this.logger.warn(
`Did not find banStatus for ${JSON.stringify(player)}`
);
}
Expand Down Expand Up @@ -260,7 +260,7 @@ export class BanService {
const updatedPlayer = await this.playerService.updateLastCheckedAt(player);

if (newBans.length) {
this.notificationService.sendNotification({
await this.notificationService.sendNotification({
player: updatedPlayer,
newBans,
deletedBans
Expand Down
28 changes: 4 additions & 24 deletions src/match/demo.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { entities, Position, Team } from '@bantr/lib/dist/entities';
import { Position, Team } from '@bantr/lib/dist/entities';
import { IMatchType } from '@bantr/lib/dist/types';
import { RoundType } from '@bantr/lib/dist/types/RoundType.enum';
import { Test, TestingModule } from '@nestjs/testing';
import { TypeOrmModule } from '@nestjs/typeorm';
import * as dotenv from 'dotenv';
import * as fs from 'fs';
import * as path from 'path';

import getDb from '../../test/getDb';
import Demo from './demo';
import Match from './match.entity';

Expand All @@ -31,31 +30,13 @@ describe('Demo handler', () => {

let demoClass: Demo;

let app: TestingModule;
let resultMatch: Match;

beforeAll(done => {
demoClass = new Demo(demoFileBuffer);

Test.createTestingModule({
imports: [
TypeOrmModule.forRoot({
type: 'postgres',
host: process.env.BANTR_PG_HOST,
port: parseInt(process.env.BANTR_PG_PORT, 10),
username: process.env.BANTR_PG_USER,
password: process.env.BANTR_PG_PW,
database: process.env.BANTR_PG_DB,
entities: entities,
//dropSchema: process.env.CI === 'true' ? true : false,
dropSchema: true,
synchronize: true
})
]
})
.compile()
.then(newApp => {
app = newApp;
getDb()
.then(() => {
const initMatch = new Match();
initMatch.externalId = 'Testing Demo 5v5 faceit';
demoClass
Expand Down Expand Up @@ -239,6 +220,5 @@ describe('Demo handler', () => {

afterAll(async () => {
await resultMatch.remove();
await app.close();
});
});

0 comments on commit a7f5528

Please sign in to comment.