Skip to content

Commit 888159e

Browse files
authored
Merge branch 'NativeScript:main' into fix-doctor-issue-with-asdf
2 parents 94b4871 + c24c682 commit 888159e

11 files changed

Lines changed: 327 additions & 248 deletions

File tree

.github/workflows/codeql-advanced.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
6161
steps:
6262
- name: Checkout repository
63-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
63+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
6464

6565
# Add any setup steps before running the `github/codeql-action/init` action.
6666
# This includes steps like installing compilers or runtimes (`actions/setup-node`
@@ -70,7 +70,7 @@ jobs:
7070

7171
# Initializes the CodeQL tools for scanning.
7272
- name: Initialize CodeQL
73-
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
73+
uses: github/codeql-action/init@87557b9c84dde89fdd9b10e88954ac2f4248e463 # v4.36.1
7474
with:
7575
languages: ${{ matrix.language }}
7676
build-mode: ${{ matrix.build-mode }}
@@ -98,6 +98,6 @@ jobs:
9898
exit 1
9999
100100
- name: Perform CodeQL Analysis
101-
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
101+
uses: github/codeql-action/analyze@87557b9c84dde89fdd9b10e88954ac2f4248e463 # v4.36.1
102102
with:
103103
category: "/language:${{matrix.language}}"

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: 'Checkout Repository'
20-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.3.0
20+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v4.3.0
2121
- name: 'Dependency Review'
22-
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
22+
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0

.github/workflows/npm_release_cli.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939

4040
steps:
4141
- name: Harden the runner (Audit all outbound calls)
42-
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
42+
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
4343
with:
4444
egress-policy: audit
4545

46-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
46+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
4747
with:
4848
fetch-depth: 0
4949
token: ${{ secrets.GITHUB_TOKEN }}
@@ -115,7 +115,7 @@ jobs:
115115
NPM_TAG: ${{needs.build.outputs.npm_tag}}
116116
steps:
117117
- name: Harden the runner (Audit all outbound calls)
118-
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
118+
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
119119
with:
120120
egress-policy: audit
121121

@@ -166,11 +166,11 @@ jobs:
166166
NPM_VERSION: ${{needs.build.outputs.npm_version}}
167167
steps:
168168
- name: Harden the runner (Audit all outbound calls)
169-
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
169+
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
170170
with:
171171
egress-policy: audit
172172

173-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
173+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
174174
with:
175175
fetch-depth: 0
176176
ref: v${{needs.build.outputs.npm_version}}

.github/workflows/npm_release_doctor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
steps:
2525

2626
- name: Harden the runner (Audit all outbound calls)
27-
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
27+
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
2828
with:
2929
egress-policy: audit
3030

31-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
31+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3232

3333
- name: Setup
3434
run: npm install

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434

3535
- name: "Checkout code"
36-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.3.0
36+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v4.3.0
3737
with:
3838
persist-credentials: false
3939

@@ -68,6 +68,6 @@ jobs:
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
71+
uses: github/codeql-action/upload-sarif@87557b9c84dde89fdd9b10e88954ac2f4248e463 # v4.36.1
7272
with:
7373
sarif_file: results.sarif

lib/common/test/unit-tests/mobile/android-emulator-service.ts

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ function createTestInjector() {
2323
testInjector.register("utils", {
2424
getMilliSecondsTimeout: () => ({}),
2525
});
26+
testInjector.register("userSettingsService", {
27+
getSettingValue: () => Promise.resolve(null),
28+
});
2629

2730
return testInjector;
2831
}
@@ -70,14 +73,14 @@ describe("androidEmulatorService", () => {
7073
const testInjector = createTestInjector();
7174
androidEmulatorServices = testInjector.resolve("androidEmulatorServices");
7275
androidVirtualDeviceService = testInjector.resolve(
73-
"androidVirtualDeviceService"
76+
"androidVirtualDeviceService",
7477
);
7578
androidGenymotionService = testInjector.resolve("androidGenymotionService");
7679
});
7780

7881
function mockGetEmulatorImages(
7982
avds: Mobile.IEmulatorImagesOutput,
80-
genies: Mobile.IEmulatorImagesOutput
83+
genies: Mobile.IEmulatorImagesOutput,
8184
) {
8285
androidVirtualDeviceService.getEmulatorImages = () => Promise.resolve(avds);
8386
androidGenymotionService.getEmulatorImages = () => Promise.resolve(genies);
@@ -94,7 +97,7 @@ describe("androidEmulatorService", () => {
9497
it("should return [] when there are no emulators are available", async () => {
9598
mockGetEmulatorImages(
9699
{ devices: [], errors: [] },
97-
{ devices: [], errors: [] }
100+
{ devices: [], errors: [] },
98101
);
99102
const output = await androidEmulatorServices.getEmulatorImages();
100103
assert.deepStrictEqual(output.devices, []);
@@ -103,7 +106,7 @@ describe("androidEmulatorService", () => {
103106
it("should return avd emulators when only avd emulators are available", async () => {
104107
mockGetEmulatorImages(
105108
{ devices: [avdEmulator], errors: [] },
106-
{ devices: [], errors: [] }
109+
{ devices: [], errors: [] },
107110
);
108111
const output = await androidEmulatorServices.getEmulatorImages();
109112
assert.deepStrictEqual(output.devices, [avdEmulator]);
@@ -112,7 +115,7 @@ describe("androidEmulatorService", () => {
112115
it("should return geny emulators when only geny emulators are available", async () => {
113116
mockGetEmulatorImages(
114117
{ devices: [], errors: [] },
115-
{ devices: [genyEmulator], errors: [] }
118+
{ devices: [genyEmulator], errors: [] },
116119
);
117120
const output = await androidEmulatorServices.getEmulatorImages();
118121
assert.deepStrictEqual(output.devices, [genyEmulator]);
@@ -121,19 +124,19 @@ describe("androidEmulatorService", () => {
121124
it("should return avd and geny emulators when avd and geny emulators are available", async () => {
122125
mockGetEmulatorImages(
123126
{ devices: [avdEmulator], errors: [] },
124-
{ devices: [genyEmulator], errors: [] }
127+
{ devices: [genyEmulator], errors: [] },
125128
);
126129
const output = await androidEmulatorServices.getEmulatorImages();
127130
assert.deepStrictEqual(
128131
output.devices,
129-
[avdEmulator].concat([genyEmulator])
132+
[avdEmulator].concat([genyEmulator]),
130133
);
131134
assert.deepStrictEqual(output.errors, []);
132135
});
133136
it("should return an error when avd error is thrown", async () => {
134137
mockGetEmulatorImages(
135138
{ devices: [], errors: [mockError] },
136-
{ devices: [], errors: [] }
139+
{ devices: [], errors: [] },
137140
);
138141
const output = await androidEmulatorServices.getEmulatorImages();
139142
assert.deepStrictEqual(output.devices, []);
@@ -142,7 +145,7 @@ describe("androidEmulatorService", () => {
142145
it("should return an error when geny error is thrown", async () => {
143146
mockGetEmulatorImages(
144147
{ devices: [], errors: [] },
145-
{ devices: [], errors: [mockError] }
148+
{ devices: [], errors: [mockError] },
146149
);
147150
const output = await androidEmulatorServices.getEmulatorImages();
148151
assert.deepStrictEqual(output.devices, []);
@@ -151,7 +154,7 @@ describe("androidEmulatorService", () => {
151154
it("should return an error when avd and geny errors are thrown", async () => {
152155
mockGetEmulatorImages(
153156
{ devices: [], errors: [mockError] },
154-
{ devices: [], errors: [mockError] }
157+
{ devices: [], errors: [mockError] },
155158
);
156159
const output = await androidEmulatorServices.getEmulatorImages();
157160
assert.deepStrictEqual(output.devices, []);
@@ -192,47 +195,42 @@ describe("androidEmulatorService", () => {
192195

193196
it("should return null when no emulators are available", async () => {
194197
mockGetRunningEmulatorName({});
195-
const emulatorName = await androidEmulatorServices.getRunningEmulatorName(
196-
""
197-
);
198+
const emulatorName =
199+
await androidEmulatorServices.getRunningEmulatorName("");
198200
assert.deepStrictEqual(emulatorName, undefined);
199201
});
200202
it("should return null when there are available emulators but the provided emulatorId is not found", async () => {
201203
mockGetRunningEmulatorName({});
202-
const emulatorName = await androidEmulatorServices.getRunningEmulatorName(
203-
"my emulator Id"
204-
);
204+
const emulatorName =
205+
await androidEmulatorServices.getRunningEmulatorName("my emulator Id");
205206
assert.deepStrictEqual(emulatorName, undefined);
206207
});
207208
it("should return avd emulator when the provided emulatorId is found", async () => {
208209
mockGetRunningEmulatorName({ avd: avdEmulatorName });
209-
const emulatorName = await androidEmulatorServices.getRunningEmulatorName(
210-
avdEmulatorName
211-
);
210+
const emulatorName =
211+
await androidEmulatorServices.getRunningEmulatorName(avdEmulatorName);
212212
assert.deepStrictEqual(emulatorName, avdEmulatorName);
213213
});
214214
it("should return geny emulator when the provided emulatorId is found", async () => {
215215
mockGetRunningEmulatorName({ geny: genyEmulatorName });
216-
const emulatorName = await androidEmulatorServices.getRunningEmulatorName(
217-
genyEmulatorName
218-
);
216+
const emulatorName =
217+
await androidEmulatorServices.getRunningEmulatorName(genyEmulatorName);
219218
assert.deepStrictEqual(emulatorName, genyEmulatorName);
220219
});
221220
it("should return avd emulator when there are avd and geny emulators", async () => {
222221
mockGetRunningEmulatorName({
223222
avd: avdEmulatorName,
224223
geny: genyEmulatorName,
225224
});
226-
const emulatorName = await androidEmulatorServices.getRunningEmulatorName(
227-
avdEmulatorName
228-
);
225+
const emulatorName =
226+
await androidEmulatorServices.getRunningEmulatorName(avdEmulatorName);
229227
assert.deepStrictEqual(emulatorName, avdEmulatorName);
230228
});
231229
});
232230

233231
describe("startEmulator", () => {
234232
function mockStartEmulator(
235-
deviceInfo: Mobile.IDeviceInfo
233+
deviceInfo: Mobile.IDeviceInfo,
236234
): Mobile.IDeviceInfo {
237235
if (deviceInfo.vendor === "Avd") {
238236
androidVirtualDeviceService.startEmulatorArgs = () => [];
@@ -249,7 +247,7 @@ describe("androidEmulatorService", () => {
249247
mockGetRunningEmulatorIds([], []);
250248
mockGetEmulatorImages(
251249
{ devices: [avdEmulator], errors: [] },
252-
{ devices: [], errors: [] }
250+
{ devices: [], errors: [] },
253251
);
254252
const deviceInfo = mockStartEmulator(avdEmulator);
255253
await androidEmulatorServices.startEmulator(avdEmulator);
@@ -259,7 +257,7 @@ describe("androidEmulatorService", () => {
259257
mockGetRunningEmulatorIds([], []);
260258
mockGetEmulatorImages(
261259
{ devices: [], errors: [] },
262-
{ devices: [genyEmulator], errors: [] }
260+
{ devices: [genyEmulator], errors: [] },
263261
);
264262
const deviceInfo = mockStartEmulator(genyEmulator);
265263
assert.deepStrictEqual(deviceInfo, genyEmulator);

0 commit comments

Comments
 (0)