Skip to content

Commit 84b1416

Browse files
committed
fix: address Android coverage review findings
1 parent 08816a3 commit 84b1416

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"platforms": ["android"],
33
"android": {
4-
"modules": ["PushBroadcastLabModule"]
4+
"modules": ["expo.modules.pushbroadcastlab.PushBroadcastLabModule"]
55
}
66
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import assert from 'node:assert/strict';
2+
import fs from 'node:fs';
3+
import os from 'node:os';
4+
import path from 'node:path';
5+
import test from 'node:test';
6+
7+
import { PUBLIC_COMMANDS } from '../../src/command-catalog.ts';
8+
import { ANDROID_EMULATOR_COVERAGE_CLASSIFICATION_SUMMARY } from './android-emulator-e2e/coverage-manifest.ts';
9+
import type { LiveContext } from './android-emulator-e2e/live-harness.ts';
10+
import { writeCoverageReport } from './android-emulator-e2e/live-coverage-report.ts';
11+
12+
test('Android coverage report persists the manifest rollup and executed tier', (t) => {
13+
const artifactDir = fs.mkdtempSync(path.join(os.tmpdir(), 'agent-device-android-coverage-'));
14+
t.after(() => fs.rmSync(artifactDir, { force: true, recursive: true }));
15+
const context: LiveContext = {
16+
appId: 'com.example.fixture',
17+
appPath: '/fixture.apk',
18+
artifactDir,
19+
behaviorEvidence: {},
20+
commandEvidence: {
21+
[PUBLIC_COMMANDS.close]: ['session released'],
22+
},
23+
completedScenarios: ['smoke:capture-close'],
24+
currentScenario: 'smoke:capture-close',
25+
env: {},
26+
serial: 'emulator-5554',
27+
session: 'coverage-report',
28+
sessionOpen: false,
29+
startedAtMs: Date.now(),
30+
stepHistory: [],
31+
tier: 'full',
32+
timings: [],
33+
};
34+
35+
const report = JSON.parse(fs.readFileSync(writeCoverageReport(context), 'utf8')) as {
36+
classificationSummary: typeof ANDROID_EMULATOR_COVERAGE_CLASSIFICATION_SUMMARY;
37+
tier: LiveContext['tier'];
38+
};
39+
40+
assert.deepEqual(report.classificationSummary, ANDROID_EMULATOR_COVERAGE_CLASSIFICATION_SUMMARY);
41+
assert.equal(report.tier, 'full');
42+
});

0 commit comments

Comments
 (0)