Skip to content

Replaced should.equal() with assert.equal()#26113

Merged
EvanHahn merged 5 commits intomainfrom
should.equal-begone
Feb 3, 2026
Merged

Replaced should.equal() with assert.equal()#26113
EvanHahn merged 5 commits intomainfrom
should.equal-begone

Conversation

@EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented Feb 2, 2026

This test-only change should have no user impact.

This change is split into two commits:

  • Commit 1: replace should.equal() with assert.equal() across the codebase. Uses sed, and then imports node:assert/strict where relevant.
  • Commit 2: manual cleanups to fix that change.

Summary by CodeRabbit

  • Tests

    • Standardized the test suite to use Node.js strict assertions for consistency.
    • Tightened a few expectations (e.g., null → undefined) to match stricter checks.
    • No changes to runtime behavior or public APIs; test logic preserved.
  • Refactor

    • Modernized test code to improve maintainability without altering functionality.

Note

Low Risk
Test-only refactor with minimal logic impact; risk is limited to potential assertion semantic differences causing flaky or newly-failing tests.

Overview
Standardizes the test suite to use Node’s strict assertions by importing node:assert/strict and replacing many should.equal() calls with assert.equal() across e2e, integration, legacy, and unit tests.

Includes minor follow-up fixes to keep tests passing under stricter semantics (notably adjusting an importer test expectation for a lexical post’s mobiledoc to be undefined rather than null).

Written by Cursor Bugbot for commit 81fc4a8. This will update automatically on new commits. Configure here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

Replaced should.js assertions with Node's strict assert across many test files (e2e, integration, legacy, unit). Added const assert = require('node:assert/strict') where needed. A few expectations changed from null to undefined. CORS spy checks migrated to sinon.assert. No production code or public API changes.

Changes

Cohort / File(s) Summary
E2E Admin API Tests
ghost/core/test/e2e-api/admin/*
Added const assert = require('node:assert/strict'); replaced should.equalassert.equal across actions, integrations, members-importer, pages-legacy, posts-legacy, tags tests.
E2E Members & Frontend
ghost/core/test/e2e-api/members-comments/comments.test.js, ghost/core/test/e2e-frontend/members.test.js
Switched equality assertions to assert.equal in comment and members frontend tests.
Integration Tests
ghost/core/test/integration/...
Migrated shouldassert in exporter, importer v2, and migrations nullable-utils tests; no logic changes.
Legacy API & Models
ghost/core/test/legacy/api/admin/*, ghost/core/test/legacy/models/*
Replaced should.equal with assert.equal and added assert imports across legacy admin and model tests.
Unit Frontend: helpers / meta / utils / src
ghost/core/test/unit/frontend/helpers/*, ghost/core/test/unit/frontend/meta/*, ghost/core/test/unit/frontend/utils/*, ghost/core/test/unit/frontend/src/*
Assertions moved to assert.equal and assert imports added across helper, meta, utils and frontend-src tests.
Unit Server: models & CRUD
ghost/core/test/unit/server/models/*, ghost/core/test/unit/server/models/base/*
Switched many should.equalassert.equal across CRUD, session, user, settings, api-key, custom-theme-setting tests; imports added.
Unit Server: auth & session
ghost/core/test/unit/server/services/auth/**/*, ghost/core/test/unit/server/services/auth/session/**/*
Replaced should assertions with assert; session/store tests adjusted some expected values (null→undefined).
Unit Services: members, stripe, offers
ghost/core/test/unit/server/services/members/**/*, ghost/core/test/unit/server/services/stripe/*, ghost/core/test/unit/server/services/offers/**/*
Members CSV importer, geolocation, stripe-connect/stripe-api, and offers/domain tests moved to assert assertions; some stripe tests updated null→undefined.
Unit Server: data, importer & schema
ghost/core/test/unit/server/data/**, ghost/core/test/unit/server/data/schema/**, ghost/core/test/unit/server/data/schema/fixtures/*
Importer, migration utils, schema commands and fixture-manager tests updated to use assert assertions.
Adapters, scheduling, storage & URL
ghost/core/test/unit/server/adapters/**/*, ghost/core/test/unit/server/adapters/scheduling/*, ghost/core/test/unit/server/adapters/storage/index.test.js, ghost/core/test/unit/server/services/url/local-file-cache.test.js
Adapter, scheduling, storage and local-file-cache tests migrated to assert.equal; null checks preserved/adjusted as noted.
Middleware & CORS
ghost/core/test/unit/server/web/api/.../*, ghost/core/test/unit/server/web/api/middleware/cors.test.js
Middleware tests switched to assert.equal; CORS tests converted spy/stub checks to sinon.assert usage.
Misc single-file updates
assorted files listed in summary (e.g., image helpers, exporter, settings-helpers, tinybird, theme validation)
Many individual tests had single-line replacements of should.equalassert.equal and added const assert = require('node:assert/strict'); no production changes.

Possibly related PRs

In burrows of tests I twitch and prance,
I swap each should for assert's firm stance.
Null learns to wander; undefined peeks in,
Sinon nods, the spies all grin.
Hop—CI sings green, the rabbit winks with glee. 🐇✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: replacing should.equal() assertions with assert.equal() across test files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch should.equal-begone

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/e2e-api/members-comments/comments.test.js
ghost/core/test/legacy/models/model-posts.test.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EvanHahn EvanHahn changed the base branch from main to memberCountRounding-improve-types February 2, 2026 18:43
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
ghost/core/test/unit/frontend/src/privacy.test.js (2)

68-68: ⚠️ Potential issue | 🟡 Minor

Missed conversion: should.deepEqual()assert.deepEqual().

This assertion was not converted as part of the automated migration. For consistency with the rest of the file and the PR objective, convert to assert.deepEqual().

🔧 Proposed fix
-            should.deepEqual(parsed, {});
+            assert.deepEqual(parsed, {});

138-138: ⚠️ Potential issue | 🟡 Minor

Missed conversion: should.deepEqual()assert.deepEqual().

Same issue as line 68—this should.deepEqual() call was not converted.

🔧 Proposed fix
-            should.deepEqual(parsed, {});
+            assert.deepEqual(parsed, {});
ghost/core/test/legacy/models/model-member-stripe-customer.test.js (1)

74-81: ⚠️ Potential issue | 🟡 Minor

Fix assertion message to match expected count (Line 78).

The assertion expects 1 subscription, but the message says “two subscriptions,” which is misleading when the test fails.

Proposed fix
-            assert.equal(subscriptions.length, 1, 'Should  be two subscriptions');
+            assert.equal(subscriptions.length, 1, 'Should be one subscription');
🤖 Fix all issues with AI agents
In `@ghost/core/test/unit/server/services/stripe/stripe-api.test.js`:
- Around line 267-271: The test title "returns null if customer exists" is
inconsistent with the assertion that expects undefined; update the test
description or the assertion to match—either rename the it(...) title to
"returns undefined if customer exists" or change the assert.equal to expect
null; locate the test containing api.getCustomerIdByEmail and adjust the string
in the it(...) call or the expected value in the assertion so both the title and
the assertion align.

In `@ghost/core/test/unit/server/web/api/middleware/cors.test.js`:
- Around line 1-2: Remove the unused assert import statement by deleting the
line that declares const assert = require('node:assert/strict'); and keep the
const should = require('should'); import as-is so remaining should.not.exist and
.should.equal assertions continue to work; ensure no other references to the
assert symbol remain in the file after removal.
🧹 Nitpick comments (13)
ghost/core/test/unit/server/web/api/middleware/update-user-last-seen.test.js (1)

1-2: Remove unused should import.

The should module is imported but no longer used after migrating to assert.equal(). This is likely a leftover from the automated replacement.

🧹 Proposed fix to remove unused import
 const assert = require('node:assert/strict');
-const should = require('should');
 const sinon = require('sinon');
ghost/core/test/unit/server/services/auth/members/index.test.js (1)

1-3: Remove unused should import.

The should module is still imported on line 3 but is no longer used after migrating all assertions to assert.equal().

🧹 Proposed fix
 const assert = require('node:assert/strict');
 const jwt = require('jsonwebtoken');
-const should = require('should');
 const {UnauthorizedError} = require('@tryghost/errors');
 const members = require('../../../../../../core/server/services/auth/members');
ghost/core/test/unit/frontend/src/privacy.test.js (1)

1-2: Unused should import can be removed.

The should import on line 2 is retained, but the only remaining usages are should.deepEqual() calls on lines 68 and 138. Once those are converted to assert.deepEqual(), this import should be removed.

♻️ Proposed fix after converting remaining should.deepEqual calls
 const assert = require('node:assert/strict');
-const should = require('should');
ghost/core/test/unit/server/adapters/scheduling/post-scheduling/post-scheduler.test.js (1)

84-84: Consider swapping argument order for conventional assert.equal usage.

The assert.equal convention is assert.equal(actual, expected). Having null (the expected value) as the first argument will produce inverted error messages on failure. This is a side effect of the automated sed replacement preserving the original should.equal argument order.

♻️ Suggested fix
-                assert.equal(null, adapter.schedule.args[0][0].extra.oldTime);
+                assert.equal(adapter.schedule.args[0][0].extra.oldTime, null);
ghost/core/test/unit/server/services/members/members-api/services/geolocation-service.test.js (1)

61-76: Swap argument order to follow assert.equal(actual, expected) convention.

The assert.equal arguments are reversed. Node's assert functions expect (actual, expected) order. While the assertion will still work correctly (equality is symmetric), the error messages on failure will be confusing—showing "expected undefined to equal X" instead of "expected X to equal undefined".

Proposed fix
-            assert.equal(undefined, result);
+            assert.equal(result, undefined);

             scope = nock('https://get.geojs.io').get('/v1/ip/geo/null.json').reply(200, {test: true});
             result = await service.getGeolocationFromIP(null);
             scope.isDone().should.eql(false);
-            assert.equal(undefined, result);
+            assert.equal(result, undefined);

             scope = nock('https://get.geojs.io').get('/v1/ip/geo/undefined.json').reply(200, {test: true});
             result = await service.getGeolocationFromIP(undefined);
             scope.isDone().should.eql(false);
-            assert.equal(undefined, result);
+            assert.equal(result, undefined);

             scope = nock('https://get.geojs.io').get('/v1/ip/geo/test.json').reply(200, {test: true});
             result = await service.getGeolocationFromIP('test');
             scope.isDone().should.eql(false);
-            assert.equal(undefined, result);
+            assert.equal(result, undefined);
ghost/core/test/unit/server/services/url/local-file-cache.test.js (1)

85-86: Mixed assertion styles in the same test case.

This test uses assert.equal() on line 85 but should.equal() on line 86. While this is consistent with the PR's approach of only replacing should.equal(x, null) patterns, having both styles in consecutive lines may look inconsistent.

This is a minor observation - the code is functionally correct.

ghost/core/test/unit/server/web/api/middleware/cors.test.js (1)

133-134: Inconsistent assertion: called vs calledOnce.

This test uses sinon.assert.called(res.end) while similar tests at lines 64, 79, and 111 use sinon.assert.calledOnce(res.end). If res.end should only be called once, consider using calledOnce for consistency and stricter verification.

♻️ Suggested change for consistency
-        sinon.assert.called(res.end);
+        sinon.assert.calledOnce(res.end);
ghost/core/test/unit/server/services/themes/validate.test.js (1)

6-6: Optional: Consider using node:assert/strict for consistency with newer test files.

Some test files in this codebase use require('node:assert/strict') while others use require('assert/strict'). The node: prefix makes it explicit that this is a built-in Node.js module. This is a very minor nit and can be addressed in a follow-up cleanup if desired.

ghost/core/test/unit/server/lib/image/cached-image-size-from-url.test.js (1)

80-80: LGTM!

The should.equal() calls are correctly replaced with assert.equal(). The assertions verify that the cached image object retains the original URL.

,

🔧 Optional: Use the `url` variable instead of hardcoding

Both tests already define a url variable with the same value. Using it in the assertion reduces duplication:

-        assert.equal(image.url, 'http://mysite.com/content/image/mypostcoverimage.jpg');
+        assert.equal(image.url, url);

Also applies to: 101-101

ghost/core/test/integration/migrations/nullable-utils.test.js (1)

1-2: Mixed assertion libraries remain in this file.

The should import is still required because several should.ok() calls remain (lines 162, 238, 324, 329, 338). Since the PR scope is specifically should.equal()assert.equal(), this is expected. Consider completing the migration by replacing should.ok() with assert.ok() in a follow-up to remove the should dependency entirely.

ghost/core/test/unit/server/services/lib/dynamic-redirect-manager.test.js (1)

57-57: Consider completing the assertion migration for consistency.

The file now mixes assertion styles: assert.equal() alongside should.fail(), should.ok(), .should.equal(), and .should.be.empty(). If the goal is to eventually remove the should dependency, these could be migrated to:

  • should.fail(...)assert.fail(...)
  • should.ok(...)assert.ok(...)
  • x.should.equal(y)assert.equal(x, y)
  • arr.should.be.empty()assert.deepStrictEqual(arr, []) or assert.equal(arr.length, 0)

This is optional and can be deferred since the PR explicitly targets should.equal() only.

Also applies to: 72-72, 126-128, 141-141

ghost/core/test/unit/server/data/importer/import-manager.test.js (1)

1-2: Consider removing unused should import.

The should library is imported but no longer used in this file after the migration. This could be cleaned up.

♻️ Suggested cleanup
 const assert = require('node:assert/strict');
-const should = require('should');
 const fs = require('fs-extra');
ghost/core/test/unit/server/services/adapter-manager/options-resolver.test.js (1)

1-2: Complete the assert/strict migration in this test file for consistency.

Now that node:assert/strict is imported, drop should entirely by converting the remaining assertions. This aligns with Node.js best practices—node:assert/strict is the recommended standard for new code, and the simple config object comparisons in this test have no edge cases that would cause behavioral differences.

♻️ Suggested refactor
 const assert = require('node:assert/strict');
-const should = require('should');
 
@@
-        adapterClassName.should.equal('Memory');
-        assert.equal(adapterConfig, undefined);
+        assert.equal(adapterClassName, 'Memory');
+        assert.equal(adapterConfig, undefined);
@@
-        adapterClassName.should.equal('cloud-storage');
-        adapterConfig.should.deepEqual({
+        assert.equal(adapterClassName, 'cloud-storage');
+        assert.deepEqual(adapterConfig, {
             custom: 'configValue'
         });
@@
-        adapterClassName.should.equal('local-storage');
-        adapterConfig.should.deepEqual({
+        assert.equal(adapterClassName, 'local-storage');
+        assert.deepEqual(adapterConfig, {
             custom: 'localStorageConfig'
         });
@@
-        adapterClassName.should.equal('cloud-storage');
-        adapterConfig.should.deepEqual({
+        assert.equal(adapterClassName, 'cloud-storage');
+        assert.deepEqual(adapterConfig, {
             custom: 'configValue'
         });
@@
-        adapterClassName.should.equal('Redis');
-        adapterConfig.should.deepEqual({
+        assert.equal(adapterClassName, 'Redis');
+        assert.deepEqual(adapterConfig, {
             commonConfigValue: 'common_config_value',
             adapterConfigValue: 'images_redis_value'
         });
@@
-        secondadapterClassName.should.equal('Redis');
-        secondAdapterConfig.should.deepEqual({
+        assert.equal(secondadapterClassName, 'Redis');
+        assert.deepEqual(secondAdapterConfig, {
             commonConfigValue: 'common_config_value',
             adapterConfigValue: 'settings_redis_value'
         });
@@
-        adapterClassName.should.equal('Redis');
-        adapterConfig.should.deepEqual({
+        assert.equal(adapterClassName, 'Redis');
+        assert.deepEqual(adapterConfig, {
             adapterConfigValue: 'images_redis_value'
         });
@@
-        secondadapterClassName.should.equal('Redis');
-        secondAdapterConfig.should.deepEqual({
+        assert.equal(secondadapterClassName, 'Redis');
+        assert.deepEqual(secondAdapterConfig, {
             adapterConfigValue: 'settings_redis_value'
         });
@@
-        adapterClassName.should.equal('Redis');
-        adapterConfig.should.deepEqual({
+        assert.equal(adapterClassName, 'Redis');
+        assert.deepEqual(adapterConfig, {
             commonConfigValue: 'common_config_value',
             adapterConfigValue: 'images_redis_value',
             overrideMe: 'images_override'
         });

@EvanHahn EvanHahn force-pushed the should.equal-begone branch from de9da98 to e9727ce Compare February 2, 2026 21:36
Base automatically changed from memberCountRounding-improve-types to main February 3, 2026 15:36
@EvanHahn EvanHahn force-pushed the should.equal-begone branch from e9727ce to a9039da Compare February 3, 2026 15:38
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@ghost/core/test/legacy/models/model-member-stripe-customer.test.js`:
- Line 78: Update the assertion message for the assert.equal call that checks
subscriptions.length: the message currently reads "Should  be two subscriptions"
but the assertion expects 1 and contains a double-space; change it to a correct,
concise message like "Should be one subscription" (refer to the
assert.equal(subscriptions.length, 1, ...) usage) so the message matches the
expected value and remove the extra space.

In
`@ghost/core/test/unit/server/services/adapter-manager/options-resolver.test.js`:
- Around line 16-19: Replace the mixed assertion on adapterConfig with the
file's predominant should-style: in the test that calls
resolveAdapterOptions(name, adapterServiceConfig) change the
assert.equal(adapterConfig, undefined) assertion to use
adapterConfig.should.equal(undefined) so both adapterClassName and adapterConfig
use should.equal() consistently.
🧹 Nitpick comments (4)
ghost/core/test/unit/server/services/auth/session/store.test.js (2)

7-7: Consider replacing should.deepEqual with assert.deepEqual to complete the migration.

The should import on line 7 is retained only for should.deepEqual on line 109. Replacing it with assert.deepEqual() would allow removing the should dependency entirely from this file.

♻️ Suggested change

Remove the should import:

-const should = require('should');

And update line 109:

-                should.deepEqual(session, {
-                    ice: 'cube'
-                });
+                assert.deepEqual(session, {
+                    ice: 'cube'
+                });

Also applies to: 109-111


20-20: Consider using assert.ok() for boolean checks.

For instanceof checks, assert.ok() is more idiomatic than assert.equal(..., true).

♻️ Suggested change
-            assert.equal(store instanceof EventEmitter, true);
+            assert.ok(store instanceof EventEmitter);
-            assert.equal(store instanceof Store, true);
+            assert.ok(store instanceof Store);

Also applies to: 25-25

ghost/core/test/unit/server/services/settings-helpers/settings-helpers.test.js (1)

1-6: Unused should import can be removed.

The should library is imported on line 1 but is no longer used anywhere in this file after the migration to assert. Consider removing it to keep the imports clean.

🧹 Suggested cleanup
-const should = require('should');
 const sinon = require('sinon');
 const configUtils = require('../../../../utils/config-utils');
 const SettingsHelpers = require('../../../../../core/server/services/settings-helpers/settings-helpers');
 const crypto = require('crypto');
 const assert = require('assert').strict;
ghost/core/test/unit/server/models/session.test.js (1)

52-57: Consider asserting property absence explicitly.

The test description says the key should be missing; checking for undefined allows a present-but-undefined key. A direct “no key” assertion makes the intent precise.

♻️ Suggested tweak
             const formatted = format(attrs);
-            assert.equal(formatted.session_data, undefined);
+            assert.equal(Object.prototype.hasOwnProperty.call(formatted, 'session_data'), false);

@EvanHahn EvanHahn enabled auto-merge (squash) February 3, 2026 16:16
This test-only change should have no user impact.

This replaces (with a simple `sed` invocation) all occurrences of
`should.equal()` with `assert.equal()`.
Mostly, checking for `null`/`undefined` needs to be more explicit now.
@EvanHahn EvanHahn force-pushed the should.equal-begone branch from 2aa979f to 81fc4a8 Compare February 3, 2026 18:22
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@@ -1,10 +1,11 @@
const assert = require('node:assert/strict');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused should import after assertion conversion

Low Severity

const should = require('should'); is imported but never used in these files after converting all should.equal() calls to assert.equal(). Five test files have this unused import: total-paid-members.test.js, og-type.test.js, modified-date.test.js, published-date.test.js, and overrides.test.js.

Fix in Cursor Fix in Web

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@ghost/core/test/unit/server/data/schema/fixtures/fixture-manager.test.js`:
- Around line 322-325: Several assertions were partially converted: while
addFixturesForModelStub and addFixturesForRelationStub calls now use
assert.equal, there remain multiple `.should.equal()` usages left (e.g.,
assertions tied to the same fixture test cases and stubs). Replace all remaining
`.should.equal(expected)` occurrences with the equivalent assert.equal(actual,
expected) form (preserving the original actual value and expected order) by
searching for `.should.equal(` and converting each to
assert.equal(actualExpression, expectedExpression); ensure assertions related to
addFixturesForModelStub, addFixturesForRelationStub and any other test variables
use the same assert style for consistency.

In `@ghost/core/test/unit/server/web/api/middleware/cors.test.js`:
- Line 132: Test assertion for res.end is less strict than others; update the
assertion in cors.test.js from sinon.assert.called(res.end) to
sinon.assert.calledOnce(res.end) so it matches other tests (lines that use
calledOnce) and will catch multiple calls to res.end; locate the assertion
referencing res.end in the failing test and replace the sinon.assert.called call
with sinon.assert.calledOnce.
🧹 Nitpick comments (5)
ghost/core/test/unit/frontend/meta/modified-date.test.js (1)

1-2: Remove unused should import.

The should import on line 2 is no longer used after migrating all assertions to assert.equal().

🧹 Proposed fix
 const assert = require('node:assert/strict');
-const should = require('should');
 const getModifiedDate = require('../../../../core/frontend/meta/modified-date');
ghost/core/test/unit/frontend/meta/og-type.test.js (1)

1-2: Unused should import can be removed.

The should import on line 2 is no longer used after the assertion migration and should be removed.

🧹 Proposed fix to remove unused import
 const assert = require('node:assert/strict');
-const should = require('should');
 const getOgType = require('../../../../core/frontend/meta/og-type');
ghost/core/test/unit/frontend/src/privacy.test.js (1)

1-2: Consider migrating should.deepEqual() to assert.deepEqual() for consistency.

The should import is retained solely for should.deepEqual() on lines 68 and 138. Migrating these to assert.deepEqual() would allow removing the should dependency entirely from this file.

♻️ Proposed consolidation
 const assert = require('node:assert/strict');
-const should = require('should');

And at lines 68 and 138:

-            should.deepEqual(parsed, {});
+            assert.deepEqual(parsed, {});

Based on learnings: keeping PRs focused on their primary objective is preferred, so this could also be addressed in a follow-up PR if the current scope is intentional.

ghost/core/test/unit/server/adapters/scheduling/post-scheduling/post-scheduler.test.js (1)

84-84: Consider conventional argument order for assert.equal.

Node's assert.equal() conventionally uses assert.equal(actual, expected). The current order places the expected value (null) first, which will still work but may produce less intuitive error messages on failure (e.g., "expected [actual] to equal null" vs "expected null to equal [actual]").

♻️ Suggested fix
-                assert.equal(null, adapter.schedule.args[0][0].extra.oldTime);
+                assert.equal(adapter.schedule.args[0][0].extra.oldTime, null);
ghost/core/test/unit/frontend/helpers/facebook-url.test.js (1)

1-2: Consider completing the migration to assert in this file.

Only one assertion moved to assert.equal while the rest still use should.equal, which keeps mixed styles. If the PR’s goal is full migration, consider converting the remaining assertions and dropping should.

Proposed cleanup
-const should = require('should');
+// should no longer needed if all assertions use assert

@@
-        facebook_url.call({}, options).should.equal('https://www.facebook.com/hey');
+        assert.equal(facebook_url.call({}, options), 'https://www.facebook.com/hey');

@@
-        facebook_url.call({facebook: 'you/there'}, options).should.equal('https://www.facebook.com/you/there');
+        assert.equal(facebook_url.call({facebook: 'you/there'}, options), 'https://www.facebook.com/you/there');

@@
-        facebook_url.call({facebook: 'you/there'}, 'i/see/you/over/there', options)
-            .should.equal('https://www.facebook.com/i/see/you/over/there');
+        assert.equal(
+            facebook_url.call({facebook: 'you/there'}, 'i/see/you/over/there', options),
+            'https://www.facebook.com/i/see/you/over/there'
+        );

@EvanHahn EvanHahn merged commit 6122858 into main Feb 3, 2026
37 checks passed
@EvanHahn EvanHahn deleted the should.equal-begone branch February 3, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant