Skip to content

Commit 3f175b7

Browse files
authored
Merge branch 'main' into fix/invalid-jweak
2 parents 330cabc + 052cb21 commit 3f175b7

File tree

30 files changed

+1708
-138
lines changed

30 files changed

+1708
-138
lines changed

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2121
- name: 'Dependency Review'
2222
uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0

.github/workflows/npm_release.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ jobs:
2929
with:
3030
egress-policy: audit
3131

32-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
32+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3333
with:
3434
fetch-depth: 0
3535
submodules: true
36-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
36+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3737
with:
3838
node-version: 22
3939
registry-url: "https://registry.npmjs.org"
40-
- uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
40+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
4141
with:
4242
distribution: "temurin"
4343
java-version: "21"
@@ -81,12 +81,12 @@ jobs:
8181
- name: Build npm package
8282
run: ./gradlew -PgitCommitVersion=${{ github.sha }} -PnoCCache --stacktrace
8383
- name: Upload npm package artifact
84-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
84+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
8585
with:
8686
name: npm-package
8787
path: dist/nativescript-android-${{steps.npm_version_output.outputs.NPM_VERSION}}.tgz
8888
- name: Upload debug symbols
89-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
89+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
9090
with:
9191
name: debug-symbols
9292
path: test-app/runtime/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib/*
@@ -101,14 +101,14 @@ jobs:
101101
with:
102102
egress-policy: audit
103103

104-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
104+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
105105
with:
106106
submodules: true
107-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
107+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
108108
with:
109109
node-version: 22
110110
registry-url: "https://registry.npmjs.org"
111-
- uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
111+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
112112
with:
113113
distribution: "temurin"
114114
java-version: "21"
@@ -160,11 +160,11 @@ jobs:
160160
with:
161161
egress-policy: audit
162162

163-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
163+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
164164
with:
165165
node-version: 22
166166
registry-url: "https://registry.npmjs.org"
167-
- uses: actions/download-artifact@v4
167+
- uses: actions/download-artifact@v6
168168
with:
169169
name: npm-package
170170
path: dist
@@ -191,19 +191,19 @@ jobs:
191191
with:
192192
egress-policy: audit
193193

194-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
194+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
195195
with:
196196
fetch-depth: 0
197-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
197+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
198198
with:
199199
node-version: 22
200200
- name: Setup
201201
run: npm install
202-
- uses: actions/download-artifact@v4
202+
- uses: actions/download-artifact@v6
203203
with:
204204
name: npm-package
205205
path: dist
206-
- uses: actions/download-artifact@v4
206+
- uses: actions/download-artifact@v6
207207
with:
208208
name: debug-symbols
209209
path: dist/debug-symbols

.github/workflows/pull_request.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ jobs:
2121
npm_version: ${{ steps.npm_version_output.outputs.NPM_VERSION }}
2222
npm_tag: ${{ steps.npm_version_output.outputs.NPM_TAG }}
2323
steps:
24-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525
with:
2626
fetch-depth: 0
2727
submodules: true
28-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
28+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2929
with:
3030
node-version: 22
3131
registry-url: "https://registry.npmjs.org"
32-
- uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
32+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
3333
with:
3434
distribution: "temurin"
3535
java-version: "21"
@@ -73,12 +73,12 @@ jobs:
7373
- name: Build npm package
7474
run: ./gradlew -PgitCommitVersion=${{ github.sha }} -PnoCCache --stacktrace
7575
- name: Upload npm package artifact
76-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
76+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
7777
with:
7878
name: npm-package
7979
path: dist/nativescript-android-${{steps.npm_version_output.outputs.NPM_VERSION}}.tgz
8080
- name: Upload debug symbols
81-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
81+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
8282
with:
8383
name: debug-symbols
8484
path: test-app/runtime/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib/*
@@ -87,14 +87,14 @@ jobs:
8787
runs-on: macos-15-intel
8888
needs: build
8989
steps:
90-
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
90+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9191
with:
9292
submodules: true
93-
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
93+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
9494
with:
9595
node-version: 22
9696
registry-url: "https://registry.npmjs.org"
97-
- uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
97+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
9898
with:
9999
distribution: "temurin"
100100
java-version: "21"

.github/workflows/scorecards.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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
36+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3737
with:
3838
persist-credentials: false
3939

@@ -60,7 +60,7 @@ jobs:
6060
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6161
# format to the repository Actions tab.
6262
- name: "Upload artifact"
63-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
63+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
6464
with:
6565
name: SARIF file
6666
path: results.sarif

test-app/app/src/main/assets/app/Infrastructure/Jasmine/jasmine-2.0.1/boot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ var TerminalReporter = require('../jasmine-reporters/terminal_reporter').Termina
120120
env.addReporter(jasmineInterface.jsApiReporter);
121121
//
122122
env.addReporter(new TerminalReporter({
123-
verbosity: 5
123+
verbosity: 2 // Show failures and summary, but not individual passes
124124
}));
125125

126126
env.addReporter(new JUnitXmlReporter());

test-app/app/src/main/assets/app/Infrastructure/Jasmine/jasmine-reporters/junit_reporter.js

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,55 @@
215215
return;
216216
} catch (f) { errors.push(' NodeJS attempt: ' + f.message); }
217217
try {
218-
__JUnitSaveResults(text);
218+
// Instead of writing XML files, output test summary to console
219+
// Parse the XML text to extract test summary
220+
var testMatch = text.match(/tests="(\d+)"/g);
221+
var failureMatch = text.match(/failures="(\d+)"/g);
222+
var errorMatch = text.match(/errors="(\d+)"/g);
223+
var skippedMatch = text.match(/skipped="(\d+)"/g);
224+
225+
var totalTests = 0;
226+
var totalFailures = 0;
227+
var totalErrors = 0;
228+
var totalSkipped = 0;
229+
230+
// Sum up all test suite results
231+
if (testMatch) {
232+
for (var i = 0; i < testMatch.length; i++) {
233+
var match = testMatch[i].match(/tests="(\d+)"/);
234+
if (match) totalTests += parseInt(match[1]);
235+
}
236+
}
237+
238+
if (failureMatch) {
239+
for (var i = 0; i < failureMatch.length; i++) {
240+
var match = failureMatch[i].match(/failures="(\d+)"/);
241+
if (match) totalFailures += parseInt(match[1]);
242+
}
243+
}
244+
245+
if (errorMatch) {
246+
for (var i = 0; i < errorMatch.length; i++) {
247+
var match = errorMatch[i].match(/errors="(\d+)"/);
248+
if (match) totalErrors += parseInt(match[1]);
249+
}
250+
}
251+
252+
if (skippedMatch) {
253+
for (var i = 0; i < skippedMatch.length; i++) {
254+
var match = skippedMatch[i].match(/skipped="(\d+)"/);
255+
if (match) totalSkipped += parseInt(match[1]);
256+
}
257+
}
258+
259+
// Output in a format our test checker can detect
260+
var resultPrefix = (totalFailures > 0 || totalErrors > 0) ? "FAILURE:" : "SUCCESS:";
261+
console.log(resultPrefix + " " + totalTests + " specs, " + (totalFailures + totalErrors) + " failures, " + totalSkipped + " skipped");
262+
219263
return;
220-
} catch (f) { errors.push(' tns-android attempt: ' + f.message); }
264+
} catch (f) {
265+
errors.push(' tns-android console output attempt: ' + f.message);
266+
}
221267

222268
// If made it here, no write succeeded. Let user know.
223269
log("Warning: writing junit report failed for '" + path + "', '" +

test-app/app/src/main/assets/app/Infrastructure/Jasmine/jasmine-reporters/terminal_reporter.js

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
return dupe;
2121
}
2222
function log(str) {
23-
//__log(str);
24-
23+
// Use console.log so our test checker can detect the output
24+
console.log(str);
25+
26+
// Also keep the Android log for debugging
2527
android.util.Log.d("{N} Runtime Tests", str);
26-
// var con = global.console || console;
27-
// if (con && con.log && str) {
28-
// con.log(str);
29-
// }
3028
}
3129

3230

@@ -134,19 +132,59 @@
134132
} else if (self.verbosity > 2) {
135133
resultText = ' ' + (failed ? 'Failed' : skipped ? 'Skipped' : 'Passed');
136134
}
137-
log(inColor(resultText, color));
135+
136+
// Only log the single character result for non-failures to reduce noise
137+
if (!failed) {
138+
log(inColor(resultText, color));
139+
}
138140

139141
if (failed) {
140-
if (self.verbosity === 1) {
141-
log(spec.fullName);
142-
} else if (self.verbosity === 2) {
143-
log(' ');
144-
log(indentWithLevel(spec._depth, spec.fullName));
142+
// Force a simple debug message first - this should definitely appear
143+
console.log('FAILURE DETECTED: Starting failure logging');
144+
145+
// Always log detailed failure information regardless of verbosity
146+
log('');
147+
log('F'); // Show the failure marker
148+
log(inColor('FAILED TEST: ' + spec.fullName, 'red+bold'));
149+
log(inColor('Suite: ' + (spec._suite ? spec._suite.description : 'Unknown'), 'red'));
150+
151+
// Also force output directly to console.log to ensure it's captured
152+
console.log('JASMINE FAILURE: ' + spec.fullName);
153+
console.log('JASMINE SUITE: ' + (spec._suite ? spec._suite.description : 'Unknown'));
154+
155+
// Try to extract file information from the stack trace
156+
var fileInfo = 'Unknown file';
157+
if (spec.failedExpectations && spec.failedExpectations.length > 0 && spec.failedExpectations[0].stack) {
158+
var stackLines = spec.failedExpectations[0].stack.split('\n');
159+
for (var j = 0; j < stackLines.length; j++) {
160+
if (stackLines[j].includes('.js:') && stackLines[j].includes('app/')) {
161+
var match = stackLines[j].match(/app\/([^:]+\.js)/);
162+
if (match) {
163+
fileInfo = match[1];
164+
break;
165+
}
166+
}
167+
}
145168
}
146-
169+
log(inColor('File: ' + fileInfo, 'red'));
170+
console.log('JASMINE FILE: ' + fileInfo);
171+
147172
for (var i = 0, failure; i < spec.failedExpectations.length; i++) {
148-
log(inColor(indentWithLevel(spec._depth, indent_string + spec.failedExpectations[i].message), color));
173+
log(inColor(' Error: ' + spec.failedExpectations[i].message, color));
174+
console.log('JASMINE ERROR: ' + spec.failedExpectations[i].message);
175+
176+
if (spec.failedExpectations[i].stack) {
177+
// Only show first few lines of stack trace to avoid clutter
178+
var stackLines = spec.failedExpectations[i].stack.split('\n').slice(0, 3);
179+
stackLines.forEach(function(line) {
180+
if (line.trim()) {
181+
log(inColor(' ' + line.trim(), 'yellow'));
182+
console.log('JASMINE STACK: ' + line.trim());
183+
}
184+
});
185+
}
149186
}
187+
log('');
150188
}
151189
};
152190
self.suiteDone = function(suite) {

test-app/app/src/main/assets/app/boot.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,6 @@ global.__onUncaughtError = function(error){
1515

1616
require('./Infrastructure/timers');
1717

18-
global.__JUnitSaveResults = function (unitTestResults) {
19-
var pathToApp = '/data/data/com.tns.testapplication';
20-
var unitTestFileName = 'android_unit_test_results.xml';
21-
try {
22-
var javaFile = new java.io.File(pathToApp, unitTestFileName);
23-
var stream = new java.io.FileOutputStream(javaFile);
24-
var actualEncoding = 'UTF-8';
25-
var writer = new java.io.OutputStreamWriter(stream, actualEncoding);
26-
writer.write(unitTestResults);
27-
writer.close();
28-
}
29-
catch (exception) {
30-
android.util.Log.d("TEST RESULTS", 'failed writing to files dir: ' + exception)
31-
}
32-
};
33-
3418
require('./Infrastructure/Jasmine/jasmine-2.0.1/boot'); //runs jasmine, attaches the junitOutputter
3519

3620

test-app/app/src/main/assets/app/mainpage.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
__disableVerboseLogging();
2-
__log("starting tests");
32

43
// methods that common tests need to run
54
var testContent = "";
@@ -14,7 +13,6 @@ TNSGetOutput = function () {
1413
return testContent;
1514
}
1615
__approot = __dirname.substr(0, __dirname.length - 4);
17-
1816
var shared = require("./shared");
1917
shared.runRequireTests();
2018
shared.runWeakRefTests();
@@ -73,4 +71,8 @@ require("./tests/console/logTests.js");
7371
require('./tests/testURLImpl.js');
7472
require('./tests/testURLSearchParamsImpl.js');
7573
require('./tests/testPerformanceNow');
76-
require('./tests/testQueueMicrotask');
74+
require('./tests/testQueueMicrotask');
75+
76+
// ES MODULE TESTS
77+
__log("=== Running ES Modules Tests ===");
78+
require("./tests/testESModules");
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Test ES Module
2+
export const message = "Hello from ES Module!";
3+
export function greet(name) {
4+
return `Hello, ${name}!`;
5+
}
6+
7+
export const moduleType = "ES Module";
8+
export const version = "1.0.0";
9+
10+
// Export object with multiple properties
11+
export const utilities = {
12+
add: (a, b) => a + b,
13+
multiply: (a, b) => a * b,
14+
format: (str) => `[${str}]`
15+
};
16+
17+
// Default export
18+
const defaultExport = {
19+
type: "ESModule",
20+
version: "1.0.0",
21+
features: ["exports", "imports", "default-export"],
22+
status: "working"
23+
};
24+
25+
export default defaultExport;

0 commit comments

Comments
 (0)