Skip to content

Commit 2ada8e2

Browse files
committed
chore: 2.0.2
1 parent 48a002f commit 2ada8e2

10 files changed

+42
-26
lines changed

app/app.css

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
.landingContainer {
2-
background-color: #65ADF1;
2+
background-color: white;
33
}
44

55
.landingBackground {
66
horizontal-align: center;
77
vertical-align: top;
8-
opacity: 0.3;
98
}
109

1110
.landingText {
@@ -22,6 +21,7 @@
2221
.statusBar {
2322
background-color: #65ADF1;
2423
color: white;
24+
padding: 10;
2525
}
2626

2727
.statusText {
@@ -69,5 +69,13 @@
6969

7070
.failedTestDetails {
7171
font-size: 10;
72+
color: black;
7273
}
7374

75+
.btn-primary {
76+
background-color: #65ADF1;
77+
padding: 8 5 8 5;
78+
width: 250;
79+
color: white;
80+
border-radius: 6;
81+
}

app/bundle-main-page.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
2-
<GridLayout cssClass="landingContainer">
3-
<Image src="{{ imageSrc }}" stretch="none" cssClass="landingBackground"/>
2+
<GridLayout class="landingContainer">
3+
<Image src="{{ imageSrc }}" stretch="aspectFit" class="landingBackground" width="150"/>
44

5-
<Label text="{{ serverInfo }}" cssClass="landingText"/>
5+
<Label text="{{ serverInfo }}" class="landingText"/>
66
</GridLayout>
77
</Page>

app/main-page.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
2-
<GridLayout cssClass="landingContainer">
3-
<Image src="{{ imageSrc }}" stretch="none" class="landingBackground"/>
2+
<GridLayout class="landingContainer">
3+
<Image src="{{ imageSrc }}" stretch="aspectFit" class="landingBackground" width="150"/>
44

55
<Label text="{{ serverInfo }}" class="landingText"/>
66
</GridLayout>

app/main-view-model.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class TestBrokerViewModel extends Observable {
202202
}
203203
};
204204

205-
this.updateView({ serverInfo: `connecting to ${this.baseUrl}`});
205+
this.updateView({ serverInfo: `connected to ${this.baseUrl}`});
206206
let io = require('../socket.io');
207207
const socket = this.socket = io.connect(this.baseUrl, { forceBase64: true });
208208

app/run-details.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
22
<ListView items="{{ testResults }}">
33
<ListView.itemTemplate>
4-
<StackLayout cssClass="{{ success, success ? 'passedTest' : 'failedTest' }} ">
4+
<StackLayout class="{{ success, success ? 'passedTest' : 'failedTest' }} " padding="10">
55
<Label
66
text="{{ description }}"
7-
cssClass="{{ success, success ? 'passedTestTitle' : 'failedTestTitle' }}"/>
7+
class="{{ success, success ? 'passedTestTitle' : 'failedTestTitle' }}"/>
88
<Label
99
text="{{ time, 'time: ' + time + 'ms' }}"
10-
cssClass="{{ success, success ? 'passedTestDetails' : 'failedTestDetails' }}"/>
10+
class="{{ success, success ? 'passedTestDetails' : 'failedTestDetails' }}"/>
1111
<TextView
1212
text="{{ log }}"
1313
visibility="{{ success, success ? 'collapsed' : 'visible' }}"
1414
editable="false"
15-
cssClass="failedTestDetails"/>
15+
class="failedTestDetails"/>
1616
</StackLayout>
1717
</ListView.itemTemplate>
1818
</ListView>

app/test-run-page.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</StackLayout>
1717
</StackLayout>
1818

19-
<Button text="View Test Run Details" tap="{{ viewTestRunDetails }}" row="3"/>
19+
<Button text="View Test Run Details" tap="{{ viewTestRunDetails }}" row="3" class="btn-primary" marginBottom="20"/>
2020

2121
<GridLayout row="4" class="statusBar">
2222
<Label text="{{ serverInfo }}" class="statusText"/>

loaders/unit-test-loader.js

+17-10
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,24 @@ module.exports = function unitTestLoader(source, map) {
1313
const ext = extname(testPathRelativeToAppPath);
1414
const loadPath = testPathRelativeToAppPath.replace(ext, "").replace(sep, '/'); // use forward slash always
1515

16-
source = `
17-
// UNIT-TEST-LOADER START
18-
try {
19-
console.log('Loading test: ${loadPath}');
20-
global.loadModule('${loadPath}');
21-
} catch(err) {
22-
console.log('Failed to load test ${loadPath}.', err)
23-
throw new Error('Failed to load test ${loadPath}.');
16+
if (loadPath) {
17+
const platformExt = loadPath.split('.').slice(-1)[0];
18+
if (['ios', 'android'].includes(platformExt) && opts.platform !== platformExt) {
19+
source = '';
20+
} else {
21+
source = `
22+
// UNIT-TEST-LOADER START
23+
try {
24+
console.log('Loading test: ${loadPath}');
25+
global.loadModule('${loadPath}');
26+
} catch(err) {
27+
console.log('Failed to load test ${loadPath}.', err)
28+
throw new Error('Failed to load test ${loadPath}.');
29+
}
30+
// UNIT-TEST-LOADER END
31+
`;
2432
}
25-
// UNIT-TEST-LOADER END
26-
`;
33+
}
2734

2835
this.callback(null, source, map);
2936
};

nativescript.webpack.js

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function setupKarmaBuild(config, env, webpack) {
6868
.loader(join(__dirname, 'loaders', 'unit-test-loader'))
6969
.options({
7070
appPath: webpack.Utils.platform.getEntryDirPath(),
71+
platform: webpack.Utils.platform.getPlatformName()
7172
});
7273
}
7374

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript/unit-test-runner",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "NativeScript unit test runner component.",
55
"main": "app.js",
66
"scripts": {

0 commit comments

Comments
 (0)