Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-133: Add strict on BE #144

Merged
merged 4 commits into from
May 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
gh-133: Fix unit tests
littlewhywhat committed Apr 25, 2020
commit 9ac97baa3dcd61b1bc1f2ed454b2e7e41981f299
10 changes: 5 additions & 5 deletions backend/storage/StorageContext.test.ts
Original file line number Diff line number Diff line change
@@ -21,11 +21,11 @@ import { ConflictError } from '../errors/ConflictError'
import { UNIQUE_VIOLATION_CODE } from './db/db-errors'
import * as dbQueries from './db/db-queries'
import { MatchWithId } from '../types/Match'
import { Transaction } from './db/db-transactions'
jest.mock('./db/db-transactions')

const TRANSACTION_MOCK = {
executeSingleResultQuery: jest.fn(),
executeQuery: jest.fn(),
}
const MockedTransaction = Transaction as jest.Mock<Transaction>
const TRANSACTION_MOCK = new MockedTransaction() as jest.Mocked<Transaction>

describe('StorageContext', () => {
let context: StorageContext
@@ -144,7 +144,7 @@ describe('StorageContext', () => {
})
describe('when Tonda plays foosball', () => {
beforeEach(() => {
TRANSACTION_MOCK.executeSingleResultQuery.mockResolvedValueOnce(FOOSBALL_GAME)
TRANSACTION_MOCK.executeSingleResultQuery.mockResolvedValueOnce(FOOSBALL_ROW)
TRANSACTION_MOCK.executeQuery.mockResolvedValueOnce([TONDA_PLAYER_ROW])
})
it('resolves with Tonda', async () => {
2 changes: 1 addition & 1 deletion backend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
"target": "es6",
"sourceMap": true,
"noImplicitAny": true,
"typeRoots": ["./types"]
"typeRoots": ["./types", "./node_modules/@types"],
},
"exclude": [
"node_modules"