Skip to content

Commit

Permalink
fix(tests): failing kvs test
Browse files Browse the repository at this point in the history
  • Loading branch information
slvnperron committed Dec 10, 2018
1 parent a499dd5 commit fdebe39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/bp/core/database/index.tests.ts
Expand Up @@ -18,7 +18,7 @@ export function createDatabaseSuite(suiteName: string, suite: DatabaseTestSuite)
const sqlite = new Database(logger.T)
const postgres = new Database(logger.T)

describe(`DB[SQLite] ${suiteName}`, () => {
describe(`DB[SQLite] ${suiteName}`, async () => {
beforeAll(async () => {
await sqlite.initialize({
location: sqlitePath,
Expand All @@ -37,7 +37,7 @@ export function createDatabaseSuite(suiteName: string, suite: DatabaseTestSuite)
await sqlite.seedForTests()
})

suite(sqlite)
await suite(sqlite)
})

describe(`DB[Postgres] ${suiteName}`, () => {
Expand Down
1 change: 1 addition & 0 deletions src/bp/core/database/tables/index.ts
Expand Up @@ -10,6 +10,7 @@ import {
LogsTable,
NotificationsTable
} from './bot-specific'

import {
AuthRolesTable,
AuthTeamMembersTable,
Expand Down
6 changes: 4 additions & 2 deletions src/bp/core/services/kvs.test.ts
Expand Up @@ -25,12 +25,14 @@ createDatabaseSuite('KVS', (database: Database) => {
}

beforeEach(async () => {
await kvs.set(BOTID, KEY, defaultValue)
try {
await kvs.set(BOTID, KEY, defaultValue)
} catch (err) {}
})

describe('Get', () => {
it('Returns undefined if key doesnt exists', async () => {
const value = await kvs.get('', '')
const value = await kvs.get(BOTID, 'does-not-exist')
expect(value).toBeUndefined()
})

Expand Down

0 comments on commit fdebe39

Please sign in to comment.