Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new rule require-assert-message rule #45

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.x', '22.x', '23.x']
node-version: ['22.x', '23.x']
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.x', '22.x', '23.x']
node-version: ['22.x', '23.x']
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22.x'
cache: 'npm'
- name: Install Dependencies
run: npm ci --ignore-scripts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Check Label
uses: checkdigit/github-actions/check-label@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Install latest npm
run: npm install -g npm@latest
Expand Down
18 changes: 18 additions & 0 deletions docs/rules/require-assert-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Make sure message argument is always supplied to node:assert methods

## Fail

```js
assert('val1');
assert.doesNotReject(async () => {
const result = await resolvePromise();
}, Error);
assert.doesNotMatch(test, /\W/gu);
```

## Pass

```js
assert.ok(statusCode === StatusCodes.OK, 'Failed to get data.');
assert.equal('val1', 'val1', 'Both are different values');
```
Loading
Loading