You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-2Lines changed: 32 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,12 +59,42 @@ pnpm --filter @salesforce/b2c-cli run build
59
59
pnpm --filter @salesforce/b2c-tooling-sdk run build
60
60
```
61
61
62
-
### Testing and Linting
62
+
### Testing
63
+
64
+
Tests use [Mocha](https://mochajs.org/) + [Chai](https://www.chaijs.com/) with [c8](https://github.com/bcoe/c8) for coverage. HTTP mocking uses [MSW](https://mswjs.io/).
63
65
64
66
```bash
65
-
# Run all tests (also runs linter after tests)
67
+
# Run all tests with coverage (also runs linter after tests)
66
68
pnpm test
67
69
70
+
# Run tests for a specific package
71
+
pnpm --filter @salesforce/b2c-tooling-sdk run test
72
+
73
+
# Run tests without coverage (faster)
74
+
pnpm --filter @salesforce/b2c-tooling-sdk run test:unit
75
+
76
+
# Watch mode for TDD
77
+
pnpm --filter @salesforce/b2c-tooling-sdk run test:watch
78
+
79
+
# Run a specific test file
80
+
cd packages/b2c-tooling-sdk
81
+
pnpm mocha "test/clients/webdav.test.ts"
82
+
83
+
# Run tests matching a pattern
84
+
pnpm mocha --grep "uploads a file""test/**/*.test.ts"
85
+
```
86
+
87
+
#### Coverage
88
+
89
+
Coverage reports are generated in each package's `coverage/` directory:
90
+
-`coverage/index.html` - HTML report
91
+
-`coverage/lcov.info` - LCOV format for CI integration
92
+
93
+
The SDK package has a 5% coverage threshold that will fail the build if not met.
94
+
95
+
### Linting
96
+
97
+
```bash
68
98
# Run linter only
69
99
pnpm --filter @salesforce/b2c-cli run lint
70
100
pnpm --filter @salesforce/b2c-tooling-sdk run lint
0 commit comments