Repository navigation
Conversation
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #707 +/- ##
=======================================
Coverage 99.86% 99.86%
=======================================
Files 8 8
Lines 732 732
=======================================
Hits 731 731
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
zimeg
left a comment
There was a problem hiding this comment.
🧪 Comments before requesting review!
| "@types/node": "^24.19.2", | ||
| "@types/sinon": "^22.0.2", | ||
| "@vercel/ncc": "^0.45.0", | ||
| "sinon": "^22.1.0", |
There was a problem hiding this comment.
🫡 praise: Thanks for kindest stubs and such more in testing.
| }; | ||
| this.core.getInput.withArgs("errors").returns("false"); | ||
| this.core.getInput.withArgs("retries").returns("5"); | ||
| this.reset(); |
There was a problem hiding this comment.
👁️🗨️ note: This reduces duplication but I found confusing at first glance. Wont change it for now though since I think the setup and reset pattern is nice.
Summary
This pull request replaces
sinonwith the mocks built intonode:test. Tests already run onnode --testand Node 24 is the minimum version, sosinonwas one more dependency to keep updated for features the test runner already has.Mockhelper intest/index.spec.jsfirst.reset()now callsmock.reset()and builds new mocks, instead of resetting each sinon stub one at a time.node:testhas nowithArgs, the helper givescore.getInput,core.getBooleanInput, andfs.readFileSyncimplementations that check their arguments against theinputs,booleanInputs, andfilesmaps. Specs changegetInput.withArgs(k).returns(v)intomocks.inputs.set(k, v).sandbox.stub(fs), which stubbed everyfsfunction, withmock.methodonreadFileSynconly. It is the onlyfsfunction the source calls, and the mock still checks for the"utf-8"encoding.node:test:getCall(i).firstArg/lastArg→mock.calls[i].arguments[n]resolves/rejects/returns→mock.mockImplementationcalled/calledOnce→mock.callCount()calledWith→assert.deepEqualonmock.calls[i].argumentscalledWithNew→mock.calls[i].targetsinonand@types/sinonfromdevDependencies, so Dependabot stops opening bumps for them (e.g. build(deps-dev): bump @types/sinon from 22.0.0 to 22.0.2 #699).Testing
npm testreports 85 tests in 28 suites, all passing, both onmainand on this branch."utf8"instead of"utf-8"fails 7contenttests, and makinggetInputalways returnundefinedfails 13configtests.Requirements
🤖 Generated with Claude Code