Skip to content

Commit 7fe4e11

Browse files
update dependencies
1 parent 1507d9e commit 7fe4e11

File tree

10 files changed

+1410
-1024
lines changed

10 files changed

+1410
-1024
lines changed

package-lock.json

Lines changed: 1352 additions & 976 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@
6060
"tracer": "^1.3.0"
6161
},
6262
"devDependencies": {
63-
"@eslint/js": "^9.39.1",
63+
"@eslint/js": "^10.0.1",
6464
"@tsconfig/node20": "^20.1.8",
6565
"@types/archiver": "^7.0.0",
66-
"@types/jest": "^29.5.14",
66+
"@types/jest": "^30.0.0",
6767
"@types/js-yaml": "^4.0.9",
68-
"@types/node": "^20.19.0",
68+
"@types/node": "^25.4.0",
6969
"@types/progress-stream": "^2.0.5",
70-
"babel-jest": "^29.7.0",
71-
"eslint": "^9.39.1",
70+
"babel-jest": "^30.3.0",
71+
"eslint": "^10.0.3",
7272
"eslint-config-prettier": "^10.1.8",
7373
"eslint-plugin-prettier": "^5.5.4",
74-
"jest": "^29.7.0",
74+
"jest": "^30.3.0",
7575
"prettier": "^3.7.4",
7676
"ts-jest": "^29.4.6",
7777
"typescript": "^5.9.3",

src/models/maestro_options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ export default class MaestroOptions {
120120
this._report = options?.report;
121121
this._reportOutputDir = options?.reportOutputDir;
122122
// IPA files can only be tested on real iOS devices, so automatically enable realDevice
123-
this._realDevice = MaestroOptions.isIpaFile(app) || (options?.realDevice ?? false);
123+
this._realDevice =
124+
MaestroOptions.isIpaFile(app) || (options?.realDevice ?? false);
124125
this._downloadArtifacts = options?.downloadArtifacts;
125126
this._artifactsOutputDir = options?.artifactsOutputDir;
126127
this._ignoreChecksumCheck = options?.ignoreChecksumCheck ?? false;

src/providers/maestro.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
378378
const flowsPaths = this.options.flows;
379379

380380
let zipPath: string;
381-
let shouldCleanup = false;
382381

383382
// Special case: single zip file - upload directly
384383
if (flowsPaths.length === 1) {
@@ -482,12 +481,9 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
482481
realDevice: this.options.realDevice,
483482
device: this.options.device,
484483
version: this.options.version,
485-
flowCount: allFlowFiles.filter(
486-
(f) =>
487-
f.endsWith('.yaml') || f.endsWith('.yml'),
488-
).filter(
489-
(f) => !this.isConfigFile(f),
490-
).length,
484+
flowCount: allFlowFiles
485+
.filter((f) => f.endsWith('.yaml') || f.endsWith('.yml'))
486+
.filter((f) => !this.isConfigFile(f)).length,
491487
shardSplit: this.options.shardSplit,
492488
});
493489
}
@@ -496,14 +492,12 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
496492
const missingReferences = await this.findMissingReferences(
497493
allFlowFiles,
498494
allFlowFiles,
499-
baseDir,
500495
);
501496
if (!this.options.quiet && missingReferences.length > 0) {
502497
this.logMissingReferences(missingReferences, baseDir);
503498
}
504499

505500
zipPath = await this.createFlowsZip(allFlowFiles, baseDir);
506-
shouldCleanup = true;
507501

508502
try {
509503
await this.upload.upload({
@@ -514,9 +508,7 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
514508
showProgress: !this.options.quiet,
515509
});
516510
} finally {
517-
if (shouldCleanup) {
518-
await fs.promises.unlink(zipPath).catch(() => {});
519-
}
511+
await fs.promises.unlink(zipPath).catch(() => {});
520512
}
521513

522514
return true;
@@ -535,7 +527,10 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
535527
for (const configName of ['config.yaml', 'config.yml']) {
536528
const candidatePath = path.join(directory, configName);
537529
try {
538-
const configContent = await fs.promises.readFile(candidatePath, 'utf-8');
530+
const configContent = await fs.promises.readFile(
531+
candidatePath,
532+
'utf-8',
533+
);
539534
config = yaml.load(configContent) as MaestroConfig;
540535
configPath = candidatePath;
541536
break; // Use the first config file found
@@ -891,10 +886,11 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
891886
public async findMissingReferences(
892887
flowFiles: string[],
893888
allIncludedFiles: string[],
894-
baseDir?: string,
895889
): Promise<MissingFileReference[]> {
896890
const missingReferences: MissingFileReference[] = [];
897-
const includedFilesSet = new Set(allIncludedFiles.map((f) => path.resolve(f)));
891+
const includedFilesSet = new Set(
892+
allIncludedFiles.map((f) => path.resolve(f)),
893+
);
898894

899895
for (const flowFile of flowFiles) {
900896
const ext = path.extname(flowFile).toLowerCase();
@@ -1294,7 +1290,9 @@ export default class Maestro extends BaseProvider<MaestroOptions> {
12941290
utils.checkForUpdate(latestVersion);
12951291

12961292
if (this.options.debug) {
1297-
logger.debug(`API response: ${JSON.stringify(response.data, null, 2)}`);
1293+
logger.debug(
1294+
`API response: ${JSON.stringify(response.data, null, 2)}`,
1295+
);
12981296
}
12991297

13001298
return response.data;

src/utils.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ export default {
3737
isWildcardDevice(device: string | undefined): boolean {
3838
if (!device) return true;
3939
// Check for common wildcard/regex characters
40-
return device === '*' || device.includes('*') || device.includes('?') || device.includes('.*');
40+
return (
41+
device === '*' ||
42+
device.includes('*') ||
43+
device.includes('?') ||
44+
device.includes('.*')
45+
);
4146
},
4247

4348
/**
@@ -46,7 +51,12 @@ export default {
4651
isWildcardVersion(version: string | undefined): boolean {
4752
if (!version) return true;
4853
// Check for common wildcard/regex characters
49-
return version === '*' || version.includes('*') || version.includes('?') || version.includes('.*');
54+
return (
55+
version === '*' ||
56+
version.includes('*') ||
57+
version.includes('?') ||
58+
version.includes('.*')
59+
);
5060
},
5161

5262
/**
@@ -91,7 +101,9 @@ export default {
91101
),
92102
);
93103
logger.info(pc.cyan(''));
94-
logger.info(pc.cyan(' Consider these alternatives for faster execution:'));
104+
logger.info(
105+
pc.cyan(' Consider these alternatives for faster execution:'),
106+
);
95107
logger.info(
96108
pc.cyan(
97109
` • Use ${pc.white('--shard-split <n>')} to run multiple flows in the same session`,

src/utils/connectivity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export async function checkInternetConnectivity(): Promise<ConnectivityCheckResu
112112
endpointResults: [successResult],
113113
message: `Internet connectivity verified via ${successResult.endpoint} (${successResult.latencyMs}ms)`,
114114
};
115-
} catch (aggregateError) {
115+
} catch {
116116
// All endpoints failed - collect all results
117117
const endpointResults = await Promise.all(endpointPromises);
118118
const testedEndpoints = endpointResults.map((r) => r.endpoint).join(', ');

tests/providers/espresso.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ describe('Espresso', () => {
6767
// Default mock for fs.promises.open - returns valid zip magic bytes
6868
fs.promises.open = jest
6969
.fn()
70-
.mockResolvedValue(createMockFileHandle() as unknown as fs.promises.FileHandle);
70+
.mockResolvedValue(
71+
createMockFileHandle() as unknown as fs.promises.FileHandle,
72+
);
7173
});
7274

7375
describe('Validation', () => {

tests/providers/maestro.test.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ describe('Maestro', () => {
100100
// Default mock for fs.promises.open - returns valid zip magic bytes
101101
fs.promises.open = jest
102102
.fn()
103-
.mockResolvedValue(createMockFileHandle() as unknown as fs.promises.FileHandle);
103+
.mockResolvedValue(
104+
createMockFileHandle() as unknown as fs.promises.FileHandle,
105+
);
104106
});
105107

106108
describe('Validation', () => {
@@ -2945,7 +2947,8 @@ flows:
29452947
`;
29462948
const projectDir = path.resolve(path.sep, 'project');
29472949
// First call (config.yaml) fails, second call (config.yml) succeeds
2948-
fs.promises.readFile = jest.fn()
2950+
fs.promises.readFile = jest
2951+
.fn()
29492952
.mockRejectedValueOnce(new Error('ENOENT: no such file'))
29502953
.mockResolvedValueOnce(configContent);
29512954
fs.promises.readdir = jest.fn().mockResolvedValue([]);
@@ -2987,11 +2990,12 @@ flows:
29872990
it('should exclude config.yml from flow files when no config exists', async () => {
29882991
const projectDir = path.resolve(path.sep, 'project');
29892992
// Both config.yaml and config.yml fail
2990-
fs.promises.readFile = jest.fn()
2993+
fs.promises.readFile = jest
2994+
.fn()
29912995
.mockRejectedValue(new Error('ENOENT: no such file'));
29922996
fs.promises.readdir = jest.fn().mockResolvedValue([
29932997
{ name: 'flow1.yaml', isFile: () => true },
2994-
{ name: 'config.yml', isFile: () => true }, // Should be excluded as a config file
2998+
{ name: 'config.yml', isFile: () => true }, // Should be excluded as a config file
29952999
]);
29963000
fs.promises.access = jest.fn().mockResolvedValue(undefined);
29973001

@@ -4123,7 +4127,6 @@ flows:
41234127
const missingRefs = await maestro['findMissingReferences'](
41244128
[flowPath],
41254129
[flowPath], // Only flow file in included files
4126-
projectDir,
41274130
);
41284131

41294132
expect(missingRefs).toHaveLength(1);
@@ -4151,7 +4154,6 @@ flows:
41514154
const missingRefs = await maestro['findMissingReferences'](
41524155
[flowPath],
41534156
[flowPath],
4154-
projectDir,
41554157
);
41564158

41574159
expect(missingRefs).toHaveLength(1);
@@ -4172,7 +4174,6 @@ flows:
41724174
const missingRefs = await maestro['findMissingReferences'](
41734175
[flowPath],
41744176
[flowPath],
4175-
projectDir,
41764177
);
41774178

41784179
expect(missingRefs).toHaveLength(1);
@@ -4195,7 +4196,6 @@ flows:
41954196
const missingRefs = await maestro['findMissingReferences'](
41964197
[flowPath],
41974198
[flowPath],
4198-
projectDir,
41994199
);
42004200

42014201
expect(missingRefs).toHaveLength(2);
@@ -4223,7 +4223,6 @@ flows:
42234223
const missingRefs = await maestro['findMissingReferences'](
42244224
[flowPath],
42254225
[flowPath, scriptPath], // Script is included
4226-
projectDir,
42274226
);
42284227

42294228
expect(missingRefs).toHaveLength(0);
@@ -4244,7 +4243,6 @@ flows:
42444243
const missingRefs = await maestro['findMissingReferences'](
42454244
[flowPath],
42464245
[flowPath], // Script not in included files
4247-
projectDir,
42484246
);
42494247

42504248
// File is not in included files, so it should be reported
@@ -4266,7 +4264,6 @@ flows:
42664264
const missingRefs = await maestro['findMissingReferences'](
42674265
[flowPath],
42684266
[flowPath, scriptPath], // Script is in included files
4269-
projectDir,
42704267
);
42714268

42724269
// File is in included files, so no missing reference reported
@@ -4290,7 +4287,6 @@ flows:
42904287
const missingRefs = await maestro['findMissingReferences'](
42914288
[flowPath],
42924289
[flowPath],
4293-
projectDir,
42944290
);
42954291

42964292
expect(missingRefs).toHaveLength(4);
@@ -4318,7 +4314,6 @@ flows:
43184314
const missingRefs = await maestro['findMissingReferences'](
43194315
[flowPath],
43204316
[flowPath],
4321-
projectDir,
43224317
);
43234318

43244319
expect(missingRefs).toHaveLength(1);
@@ -4341,7 +4336,6 @@ onFlowStart:
43414336
const missingRefs = await maestro['findMissingReferences'](
43424337
[flowPath],
43434338
[flowPath],
4344-
projectDir,
43454339
);
43464340

43474341
expect(missingRefs).toHaveLength(1);
@@ -4360,7 +4354,6 @@ onFlowStart:
43604354
const missingRefs = await maestro['findMissingReferences'](
43614355
[flowPath],
43624356
[flowPath],
4363-
projectDir,
43644357
);
43654358

43664359
// Should not throw, just return empty
@@ -4376,7 +4369,6 @@ onFlowStart:
43764369
const missingRefs = await maestro['findMissingReferences'](
43774370
[jsPath],
43784371
[jsPath],
4379-
projectDir,
43804372
);
43814373

43824374
expect(missingRefs).toHaveLength(0);
@@ -4403,7 +4395,6 @@ onFlowStart:
44034395
const missingRefs = await maestro['findMissingReferences'](
44044396
[flowPath1, flowPath2],
44054397
[flowPath1, flowPath2],
4406-
projectDir,
44074398
);
44084399

44094400
expect(missingRefs).toHaveLength(2);

tests/providers/xcuitest.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ describe('XCUITest', () => {
6767
// Default mock for fs.promises.open - returns valid zip magic bytes
6868
fs.promises.open = jest
6969
.fn()
70-
.mockResolvedValue(createMockFileHandle() as unknown as fs.promises.FileHandle);
70+
.mockResolvedValue(
71+
createMockFileHandle() as unknown as fs.promises.FileHandle,
72+
);
7173
});
7274

7375
describe('Validation', () => {

tests/upload.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ describe('Upload', () => {
7474
jest
7575
.spyOn(fs.promises, 'open')
7676
.mockResolvedValue(
77-
createMockFileHandle(ZIP_MAGIC_BYTES) as unknown as fs.promises.FileHandle,
77+
createMockFileHandle(
78+
ZIP_MAGIC_BYTES,
79+
) as unknown as fs.promises.FileHandle,
7880
);
7981
});
8082

@@ -190,7 +192,9 @@ describe('Upload', () => {
190192
const invalidFileHandle = createMockFileHandle([0x00, 0x00, 0x00, 0x00]);
191193
jest
192194
.spyOn(fs.promises, 'open')
193-
.mockResolvedValue(invalidFileHandle as unknown as fs.promises.FileHandle);
195+
.mockResolvedValue(
196+
invalidFileHandle as unknown as fs.promises.FileHandle,
197+
);
194198

195199
const options = createUploadOptions({
196200
filePath: '/path/to/invalid.apk',

0 commit comments

Comments
 (0)