Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down