refactor: improve secure-fs throttling configuration and add unit tests

- Enhanced the configureThrottling function to prevent changes to maxConcurrency while operations are in flight.
- Added comprehensive unit tests for secure-fs throttling and retry logic, ensuring correct behavior and configuration.
- Removed outdated secure-fs test file and replaced it with a new, updated version to improve test coverage.
This commit is contained in:
Kacper
2025-12-26 22:06:39 +01:00
parent 6d3314f980
commit ad983c6422
5 changed files with 151 additions and 116 deletions

View File

@@ -130,7 +130,7 @@ describe('node-finder', () => {
const delimiter = path.delimiter;
it("should return current path unchanged when nodePath is 'node'", () => {
const currentPath = '/usr/bin:/usr/local/bin';
const currentPath = `/usr/bin${delimiter}/usr/local/bin`;
const result = buildEnhancedPath('node', currentPath);
expect(result).toBe(currentPath);
@@ -144,7 +144,7 @@ describe('node-finder', () => {
it('should prepend node directory to path', () => {
const nodePath = '/opt/homebrew/bin/node';
const currentPath = '/usr/bin:/usr/local/bin';
const currentPath = `/usr/bin${delimiter}/usr/local/bin`;
const result = buildEnhancedPath(nodePath, currentPath);
@@ -153,7 +153,7 @@ describe('node-finder', () => {
it('should not duplicate node directory if already in path', () => {
const nodePath = '/usr/local/bin/node';
const currentPath = '/usr/local/bin:/usr/bin';
const currentPath = `/usr/local/bin${delimiter}/usr/bin`;
const result = buildEnhancedPath(nodePath, currentPath);