diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67e1b44307..af25dd5ff7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,6 +48,22 @@ All samples must have tests. We use `mocha` as testing framework. The executes the `mocha` tests via `npm test` ([example](https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/main/batch/package.json#L13)). +### Third party libraries + +Contributors are encouraged to use vanilla Node.js as much as pragmatically +possible to standardize writing, reviewing, and maintaining samples and their +tests, ideally reducing dependencies on third party libraries. + +For tests, we recommend using the standard +library [assert](https://nodejs.org/docs/latest-v18.x/api/assert.html). The library provides a strict and a legacy mode; please use the +strict mode as shown below: + +```js +const assert = require('node:assert/strict'); +``` + +### CI testing + For new samples, a GitHub Actions workflow should be created to run your tests on the CI system: