Skip to content

Commit

Permalink
Add configuration to debug with VSCode
Browse files Browse the repository at this point in the history
minor fixes from eslint and yarn.lock
  • Loading branch information
manelcecs committed Oct 25, 2023
1 parent 4f69df7 commit e243c71
Show file tree
Hide file tree
Showing 5 changed files with 416 additions and 533 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
/index.d.ts
/yarn-error.log
package-lock.json

# IDE artifacts
.vscode
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Jest Tests",
"type": "node",
"preLaunchTask": "start-containers",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--runInBand",
"--detectOpenHandles"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "start-containers",
"type": "shell",
"command": "${workspaceRoot}/test.sh",
"args": ["-oc"]
}
]
}
7 changes: 3 additions & 4 deletions tests/testContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default class ContextProvider implements IContext {
transactions: Record<string, Knex.Transaction>;

private constructor() {
this.models = undefined;
this.conn = undefined;
this.transactions = undefined;
this.models = {} as Database;
this.transactions = {};
this.conn = {} as Knex;
}

public static get Instance(): ContextProvider {
Expand All @@ -34,7 +34,6 @@ export default class ContextProvider implements IContext {
const connection = await this.createDbTestConection();
this.conn = connection;
this.models = v4Models(this.conn);
this.transactions = {};
}

private async createDbTestConection(): Promise<Knex<any, unknown[]>> {
Expand Down
Loading

0 comments on commit e243c71

Please sign in to comment.