Skip to content

refactor: Add a few lint rules to test files in /spec #9815

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

Open
wants to merge 1 commit into
base: alpha
Choose a base branch
from

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Jul 2, 2025

Pull Request

Issue

Very few lint rules for spec files.

Approach

Add most lint rules that also apply to /src files.

Summary by CodeRabbit

  • Style

    • Improved code formatting, indentation, and whitespace across multiple test files for better readability and consistency.
    • Enhanced variable declaration style in tests for clearer scoping.
    • Added a newline at the end of a reporter file.
  • Chores

    • Expanded and updated ESLint configuration to enforce more comprehensive code style and quality rules.
Copy link

parse-github-assistant bot commented Jul 2, 2025

🚀 Thanks for opening this pull request!

Copy link

coderabbitai bot commented Jul 2, 2025

📝 Walkthrough

Walkthrough

The changes are limited to formatting, whitespace, and code style improvements across several test files and the ESLint configuration. No logic, control flow, or exported/public entities were altered. The ESLint configuration was expanded to enforce more stylistic and code quality rules. All modifications are non-functional.

Changes

File(s) Change Summary
spec/Adapters/Auth/gcenter.spec.js Reformatted indentation and alignment in mock fetch configuration; no logic changes.
spec/CloudCode.spec.js Adjusted whitespace, reformatted JSON strings, and tightened block formatting; no logic changes.
spec/EmailVerificationToken.spec.js Changed some let to const for single-use variables; removed trailing whitespace.
spec/ParseGraphQLServer.spec.js Removed trailing whitespace from a line in a beforeEach function.
spec/ParseLiveQuery.spec.js Removed a trailing whitespace line in a shutdown test case.
spec/ParseQuery.spec.js Removed trailing whitespace in multiple test cases.
spec/Utils.spec.js Removed extraneous spaces after a for-loop closing brace.
spec/eslint.config.js Expanded and restructured ESLint rules for style and quality; replaced minimal rules with detailed ones.
spec/support/CurrentSpecReporter.js Added a newline at the end of the file.

Sequence Diagram(s)

No sequence diagram is generated as the changes are limited to formatting and configuration updates without any control flow or feature modifications.

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.38.1)
spec/ParseGraphQLServer.spec.js
spec/ParseQuery.spec.js
🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: 'parse@6.1.1',
npm warn EBADENGINE required: { node: '18 || 19 || 20 || 22' },
npm warn EBADENGINE current: { node: 'v24.3.0', npm: '11.4.2' }
npm warn EBADENGINE }
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-02T22_56_04_329Z-debug-0.log


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.
@parseplatformorg
Copy link
Contributor

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Copy link

@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: 1

🧹 Nitpick comments (1)
spec/CloudCode.spec.js (1)

3932-4050: File-hook tests leak global triggers across specs

Each test registers beforeFind / afterFind hooks on Parse.File without tearing them down or spinning up a fresh server.
Because triggers are global, a hook from one test will still be active in the next, creating hidden ordering dependencies and race conditions (CI flakes).

Consider either:

for (const hook in hooks) {
   spyOn(hooks, hook).and.callThrough();
-  Parse.Cloud[hook](Parse.File, hooks[hook]);
+  const handle = Parse.Cloud[hook](Parse.File, hooks[hook]); // assume Cloud.<hook> returns an id
}
...
// inside afterEach
Parse.Cloud._removeHook(handle); // or reconfigureServer()

or the simpler/idiomatic pattern already used elsewhere in the suite:

await reconfigureServer();

inside an afterEach to reset the trigger registry.

This keeps the tests hermetic and prevents sporadic failures when more hooks are added later.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 207d241 and 6a58f84.

📒 Files selected for processing (9)
  • spec/Adapters/Auth/gcenter.spec.js (1 hunks)
  • spec/CloudCode.spec.js (3 hunks)
  • spec/EmailVerificationToken.spec.js (3 hunks)
  • spec/ParseGraphQLServer.spec.js (1 hunks)
  • spec/ParseLiveQuery.spec.js (1 hunks)
  • spec/ParseQuery.spec.js (4 hunks)
  • spec/Utils.spec.js (1 hunks)
  • spec/eslint.config.js (1 hunks)
  • spec/support/CurrentSpecReporter.js (1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1312-1338
Timestamp: 2025-05-04T20:41:05.147Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`.
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`. The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with `done()`. Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.
Learnt from: RahulLanjewar93
PR: parse-community/parse-server#9744
File: spec/ParseLiveQuery.spec.js:0-0
Timestamp: 2025-04-30T19:31:35.344Z
Learning: In the Parse Server codebase, the functions in QueryTools.js are typically tested through end-to-end behavior tests rather than direct unit tests, even though the functions are exported from the module.
spec/EmailVerificationToken.spec.js (3)
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`. The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with `done()`. Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1312-1338
Timestamp: 2025-05-04T20:41:05.147Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`.
spec/Adapters/Auth/gcenter.spec.js (3)
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with `done()`. Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1312-1338
Timestamp: 2025-05-04T20:41:05.147Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`.
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`. The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.
spec/ParseLiveQuery.spec.js (4)
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with `done()`. Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.
Learnt from: RahulLanjewar93
PR: parse-community/parse-server#9744
File: spec/ParseLiveQuery.spec.js:0-0
Timestamp: 2025-04-30T19:31:35.344Z
Learning: In the Parse Server codebase, the functions in QueryTools.js are typically tested through end-to-end behavior tests rather than direct unit tests, even though the functions are exported from the module.
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`. The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1312-1338
Timestamp: 2025-05-04T20:41:05.147Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`.
spec/CloudCode.spec.js (4)

undefined

<retrieved_learning>
Learnt from: mtrezza
PR: #9445
File: spec/ParseLiveQuery.spec.js:1312-1338
Timestamp: 2025-05-04T20:41:05.147Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with done().
</retrieved_learning>

<retrieved_learning>
Learnt from: mtrezza
PR: #9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with done(). Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.
</retrieved_learning>

<retrieved_learning>
Learnt from: mtrezza
PR: #9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with done(). The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.
</retrieved_learning>

<retrieved_learning>
Learnt from: RahulLanjewar93
PR: #9744
File: spec/ParseLiveQuery.spec.js:0-0
Timestamp: 2025-04-30T19:31:35.344Z
Learning: In the Parse Server codebase, the functions in QueryTools.js are typically tested through end-to-end behavior tests rather than direct unit tests, even though the functions are exported from the module.
</retrieved_learning>

spec/Utils.spec.js (1)
Learnt from: mtrezza
PR: parse-community/parse-server#9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with `done()`. Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.
spec/ParseGraphQLServer.spec.js (4)

undefined

<retrieved_learning>
Learnt from: mtrezza
PR: #9445
File: spec/ParseLiveQuery.spec.js:1312-1338
Timestamp: 2025-05-04T20:41:05.147Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with done().
</retrieved_learning>

<retrieved_learning>
Learnt from: RahulLanjewar93
PR: #9744
File: spec/ParseLiveQuery.spec.js:0-0
Timestamp: 2025-04-30T19:31:35.344Z
Learning: In the Parse Server codebase, the functions in QueryTools.js are typically tested through end-to-end behavior tests rather than direct unit tests, even though the functions are exported from the module.
</retrieved_learning>

<retrieved_learning>
Learnt from: mtrezza
PR: #9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with done(). The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.
</retrieved_learning>

<retrieved_learning>
Learnt from: mtrezza
PR: #9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with done(). Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.
</retrieved_learning>

spec/ParseQuery.spec.js (4)

undefined

<retrieved_learning>
Learnt from: RahulLanjewar93
PR: #9744
File: spec/ParseLiveQuery.spec.js:0-0
Timestamp: 2025-04-30T19:31:35.344Z
Learning: In the Parse Server codebase, the functions in QueryTools.js are typically tested through end-to-end behavior tests rather than direct unit tests, even though the functions are exported from the module.
</retrieved_learning>

<retrieved_learning>
Learnt from: mtrezza
PR: #9445
File: spec/ParseLiveQuery.spec.js:1312-1338
Timestamp: 2025-05-04T20:41:05.147Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with done().
</retrieved_learning>

<retrieved_learning>
Learnt from: mtrezza
PR: #9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with done(). The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.
</retrieved_learning>

<retrieved_learning>
Learnt from: mtrezza
PR: #9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with done(). Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.
</retrieved_learning>

⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: PostgreSQL 15, PostGIS 3.5
  • GitHub Check: PostgreSQL 17, PostGIS 3.5
  • GitHub Check: PostgreSQL 16, PostGIS 3.5
  • GitHub Check: PostgreSQL 15, PostGIS 3.4
  • GitHub Check: Node 20
  • GitHub Check: Node 18
  • GitHub Check: MongoDB 8, ReplicaSet
  • GitHub Check: PostgreSQL 15, PostGIS 3.3
  • GitHub Check: MongoDB 7, ReplicaSet
  • GitHub Check: Redis Cache
  • GitHub Check: MongoDB 6, ReplicaSet
  • GitHub Check: Docker Build
🔇 Additional comments (9)
spec/eslint.config.js (1)

51-65: Excellent ESLint rule additions for code consistency.

The comprehensive set of formatting and style rules will significantly improve code consistency across the test files. The rules cover all the essential aspects:

  • Consistent indentation and spacing
  • Unix line endings and end-of-file newlines
  • Proper use of const over let/var
  • Consistent object and block spacing

The disabled rules (no-unused-vars, no-useless-escape, require-atomic-updates) are appropriate choices for test files where these rules can be overly restrictive.

spec/support/CurrentSpecReporter.js (1)

117-118: LGTM - Formatting compliance with ESLint rules.

The newline addition at the end of the file aligns with the eol-last ESLint rule introduced in the configuration. This is a standard formatting practice.

spec/Utils.spec.js (1)

11-11: LGTM - Trailing whitespace cleanup.

The trailing whitespace removal aligns with the no-trailing-spaces ESLint rule introduced in the configuration. This formatting cleanup improves code consistency.

spec/ParseGraphQLServer.spec.js (1)

459-459: Whitespace cleanup conforms to new lint rules — looks good
This change is purely stylistic and keeps the test file compliant with the stricter ESLint configuration introduced by the PR. No functional impact.

spec/ParseLiveQuery.spec.js (1)

1185-1186: Nice catch – stray whitespace removed.

No functional impact, but eliminates unnecessary diff noise going forward.

spec/ParseQuery.spec.js (1)

5310-5376: LGTM – only whitespace / stylistic nits, no functional impact

The touched lines are confined to the three new-line blocks inside the describe_only_db('mongo')('query nested keys', …) section.
No logic was modified, tests still follow the agreed-upon async/await pattern (see learnings), and assertions remain intact.
Happy to approve.

spec/Adapters/Auth/gcenter.spec.js (1)

15-36: Formatting-only change looks good

Indentation is now consistent with the surrounding code; no functional impact detected.

spec/EmailVerificationToken.spec.js (2)

682-683: �� Switched to const for immutable references

Promoting userBeforeEmailReset and userBeforeRequest to const accurately reflects immutability and prevents accidental reassignment. No other adjustments needed.

Also applies to: 749-750


1010-1013: Whitespace cleanup acknowledged

Trailing-space removal has no behavioural effect and improves lint compliance.

Comment on lines 3503 to +3507
'X-Parse-Cloud-Context': '{"a":"a"}',
},
body: JSON.stringify({_context: { hello: 'world' }}),
body: JSON.stringify({ _context: { hello: 'world' } }),
});

Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Avoid double-encoding the request body

lib/request already JSON-serialises plain objects that are passed via the body field (see other tests in this file).
Passing a pre-stringified payload here will therefore lead to a double JSON encoding on the wire:

{"body":"{\"_context\":{\"hello\":\"world\"}}"}

which breaks the server-side deserialisation and defeats the purpose of the test.

-      body: JSON.stringify({ _context: { hello: 'world' } }),
+      body: { _context: { hello: 'world' } },

Run the test suite after applying the patch – this part currently fails if the server expects a structured JSON object.


I’ll verify how lib/request handles the body field and check other tests in spec/CloudCode.spec.js for examples of plain-object bodies.

#!/bin/bash
set -e

echo "1) Sample 'body:' usages in spec/CloudCode.spec.js:"
rg -n "body:" spec/CloudCode.spec.js | head -n 20 || true

echo
echo "2) Locating lib/request implementation:"
REQUEST_FILE=$(fd -t f --hidden --glob "request.js" lib || echo "")
if [[ -z "$REQUEST_FILE" ]]; then
  echo "lib/request.js not found under lib/, searching entire repo..."
  REQUEST_FILE=$(fd -t f --hidden --glob "request.js" .)
fi
echo "Found: $REQUEST_FILE"

echo
echo "3) Inspecting lib/request.js for JSON serialization logic:"
sed -n '1,200p' "$REQUEST_FILE"

I’ll verify the body handling in lib/request and how other tests use plain-object bodies:

#!/usr/bin/env bash
set -e

# 1) Locate the request implementation
REQUEST_FILE=$(fd -t f --glob "request.js" lib | head -n1)
if [[ -z "$REQUEST_FILE" ]]; then
  REQUEST_FILE=$(fd -t f --glob "request.js" . | head -n1)
fi
echo "Using: $REQUEST_FILE"

# 2) Show the top of lib/request.js to find body serialization logic
echo "----- lib/request.js (first 200 lines) -----"
sed -n '1,200p' "$REQUEST_FILE"

# 3) Look for JSON.stringify usage in lib/request.js
echo
echo "----- JSON.stringify calls in lib/request.js -----"
rg -n "JSON.stringify" "$REQUEST_FILE" || echo "No JSON.stringify found"

# 4) See how other tests pass `body` in CloudCode.spec.js
echo
echo "----- Examples of body: in spec/CloudCode.spec.js -----"
rg -n "body:" spec/CloudCode.spec.js | head -n20 || true

Avoid double-encoding the request body

lib/request already JSON-serializes plain objects passed via the body field. Wrapping the payload in JSON.stringify here causes a double-encoding on the wire and breaks server-side deserialization.

Locations to update:

  • spec/CloudCode.spec.js around line 3503

Required change:

-      body: JSON.stringify({ _context: { hello: 'world' } }),
+      body: { _context: { hello: 'world' } },

Run the test suite after applying this patch to confirm the fix.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'X-Parse-Cloud-Context': '{"a":"a"}',
},
body: JSON.stringify({_context: { hello: 'world' }}),
body: JSON.stringify({ _context: { hello: 'world' } }),
});
'X-Parse-Cloud-Context': '{"a":"a"}',
},
body: { _context: { hello: 'world' } },
});
🤖 Prompt for AI Agents
In spec/CloudCode.spec.js around lines 3503 to 3507, the request body is being
double-encoded by calling JSON.stringify on an object that lib/request already
serializes. Remove the JSON.stringify call and pass the plain object directly to
the body field to avoid double-encoding and ensure proper server-side
deserialization.
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.00%. Comparing base (207d241) to head (6a58f84).

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha    #9815   +/-   ##
=======================================
  Coverage   93.00%   93.00%           
=======================================
  Files         187      187           
  Lines       15082    15082           
  Branches      174      174           
=======================================
  Hits        14027    14027           
  Misses       1043     1043           
  Partials       12       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants