Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 421bc83

Browse files
authored
test(core): add settings for "Jest" extension for vsCode (#407) (#408)
* Add settings for jest extention * Correct import name in test
1 parent 63d6b7d commit 421bc83

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

.vscode/launch.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
6+
/*
7+
Because of lack of extention "Jest" there have to be corrections depends on test scope u want to debug:
8+
9+
replace cwd source folder (line 25):
10+
"cwd": "${workspaceFolder}/packages/api", <- to debug tests in api
11+
"cwd": "${workspaceFolder}/packages/ui", <- to debug tests in ui
12+
"cwd": "${workspaceFolder}/packages/{scope}", <- to debug tests in given {scope}
13+
*/
14+
15+
"version": "0.2.0",
16+
"configurations": [
17+
{
18+
"type": "node",
19+
"name": "vscode-jest-tests",
20+
"request": "launch",
21+
"args": [
22+
"--runInBand",
23+
"--watchAll=false"
24+
],
25+
"cwd": "${workspaceFolder}/packages/api",
26+
"console": "integratedTerminal",
27+
"internalConsoleOptions": "neverOpen",
28+
"disableOptimisticBPs": true,
29+
"program": "${workspaceFolder}/node_modules/.bin/jest",
30+
"windows": {
31+
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
32+
},
33+
},
34+
]
35+
}

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@
3939
},
4040
"[yaml]": {
4141
"editor.defaultFormatter": "redhat.vscode-yaml"
42-
}
42+
},
43+
"jest.jestCommandLine": "yarn test",
44+
"jest.autoRun": "off"
45+
4346
}

packages/api/src/module/automation/when-email-confirmation-was-approved-then-complete-user-registration/when-email-confirmation-was-approved-then-complete-user-registration.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { completeUserRegistrationCommand } from '@/module/commands/complete-user
44
import { emailConfirmationWasApprovedEvent } from '@/module/events/email-confirmation-was-approved.domain.event';
55
import { EventStreamName } from '@/write/shared/application/event-stream-name.value-object';
66

7-
import { WhenEmailConfirmationWasApprovedThenCompleteUserRegistrationAutomationModuleAutomationTestModule as WhenEmailConfirmationWasApprovedThenCompleteUserRegistrationAutomationTestModule } from './when-email-confirmation-was-approved-then-complete-user-registration.test-module';
7+
import { WhenEmailConfirmationWasApprovedThenCompleteUserRegistrationAutomationTestModule } from './when-email-confirmation-was-approved-then-complete-user-registration.test-module';
88

99
describe('CompleteUser registration when emailConfirmationWasApproved', () => {
1010
let moduleUnderTest: AsyncReturnType<

packages/api/src/module/automation/when-email-confirmation-was-approved-then-complete-user-registration/when-email-confirmation-was-approved-then-complete-user-registration.test-module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { initAutomationTestModule } from '@/shared/test-utils';
22

33
import { WhenEmailConfirmationWasApprovedThenCompleteUserRegistrationAutomationModule } from './when-email-confirmation-was-approved-then-complete-user-registration-automation.module';
44

5-
export async function WhenEmailConfirmationWasApprovedThenCompleteUserRegistrationAutomationModuleAutomationTestModule() {
5+
export async function WhenEmailConfirmationWasApprovedThenCompleteUserRegistrationAutomationTestModule() {
66
return initAutomationTestModule([WhenEmailConfirmationWasApprovedThenCompleteUserRegistrationAutomationModule]);
77
}

0 commit comments

Comments
 (0)