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: CONTRIBUTING.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,6 @@ Issues labelled `good first contribution`.
52
52
-[x] Tests
53
53
- The test suite, if provided, must be complete and pass
54
54
- Increase code coverage, not versa.
55
-
- Use any of our testkits that contains a bunch of testing facilities you would need. For example: `import com.salesforce.op.test._` and borrow inspiration from existing tests.
56
55
-[x] Dependencies
57
56
- Minimize number of dependencies.
58
57
- Prefer Apache 2.0, BSD3, MIT, ISC and MPL licenses.
Copy file name to clipboardExpand all lines: README.md
+44-2Lines changed: 44 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
@@ -142,3 +172,15 @@ import { getLogger } from '@salesforce/b2c-tooling-sdk/logging';
142
172
```
143
173
144
174
The `development` condition in exports enables direct TypeScript source resolution when using `--conditions=development`, which is how `bin/dev.js` works for local development.
175
+
176
+
## Contributing
177
+
178
+
We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details on how to get started, submit pull requests, and our code of conduct.
179
+
180
+
## Security
181
+
182
+
For security concerns, please review our [Security Policy](./SECURITY.md). Report any security issues to [security@salesforce.com](mailto:security@salesforce.com).
183
+
184
+
## License
185
+
186
+
This project is licensed under the Apache License 2.0. See [LICENSE.txt](./LICENSE.txt) for full details.
0 commit comments