Replaced value.should.be.empty() with node:assert#26428
Conversation
|
No actionable comments were generated in the recent review. 🎉 WalkthroughThis PR standardizes test assertions across multiple suites: it replaces Should.js assertions with Node's Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.40.5)ghost/core/test/legacy/models/model-posts.test.jsThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/core/test/e2e-api/admin/integrations.test.js`:
- Around line 351-353: The inner callback parameter named "res" in the test
inside integrations.test.js shadows the outer "res" constant; rename the inner
parameter (for example to "response" or "result") and update its usage in the
arrow callback (e.g. assert.deepEqual(response.body, {})) to avoid the ESLint
no-shadow violation while preserving the exact assertion logic in the test
function.
94aa3c0 to
4fbb9f5
Compare
There was a problem hiding this comment.
🤖 Fix all issues with AI agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/core/test/e2e-api/admin/redirects.test.js`:
- Line 2: Remove the unused import of the should assertion library: delete the
require statement that assigns to the symbol "should" (the top-level const
should = require('should');) since all assertions use Node's assert.deepEqual(),
leaving no references to "should" in the file; ensure no other references remain
after removal and run the tests to verify.
🧹 Nitpick comments (1)
🤖 Fix all nitpicks with AI agents
Verify each finding against the current code and only fix it if needed. In `@ghost/core/test/e2e-api/admin/redirects.test.js`: - Line 2: Remove the unused import of the should assertion library: delete the require statement that assigns to the symbol "should" (the top-level const should = require('should');) since all assertions use Node's assert.deepEqual(), leaving no references to "should" in the file; ensure no other references remain after removal and run the tests to verify.ghost/core/test/e2e-api/admin/redirects.test.js (1)
2-2: Remove unusedshouldimport.The
shouldmodule is imported but no longer used in this file. All assertions useassert.deepEqual()from Node's strict assertion module.Proposed fix
const assert = require('node:assert/strict'); -const should = require('should'); const supertest = require('supertest');🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ghost/core/test/e2e-api/admin/redirects.test.js` at line 2, Remove the unused import of the should assertion library: delete the require statement that assigns to the symbol "should" (the top-level const should = require('should');) since all assertions use Node's assert.deepEqual(), leaving no references to "should" in the file; ensure no other references remain after removal and run the tests to verify.
This test-only change should have no user impact.
4fbb9f5 to
a0a1e47
Compare
This test-only change should have no user impact.