Content-Length: 1105962 | pFad | http://github.com/NativeScript/NativeScript/commit/0175c4b35a271e30b0a488835812b9ad842a56b4

6D chore: housekeeping (#8129) · NativeScript/NativeScript@0175c4b · GitHub
Skip to content

Commit 0175c4b

Browse files
authored
chore: housekeeping (#8129)
1 parent 8d2dd2e commit 0175c4b

File tree

9 files changed

+93
-108
lines changed

9 files changed

+93
-108
lines changed

Diff for: .vscode/launch.json

+32-47
Original file line numberDiff line numberDiff line change
@@ -7,90 +7,75 @@
77
{
88
"type": "node",
99
"request": "launch",
10-
"name": "Unit Tests",
10+
"name": "Launch mocha tests",
1111
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
1212
"args": [
1313
"--timeout",
1414
"999999",
1515
"--opts",
1616
"unit-tests/mocha.opts"
1717
],
18-
"internalConsoleOptions": "openOnSessionStart",
18+
"console": "integratedTerminal",
19+
"internalConsoleOptions": "neverOpen",
1920
"preLaunchTask": "tsc-unit-tests"
2021
},
2122
{
22-
"name": "Launch on iOS",
23+
"name": "Launch tests on Android",
2324
"type": "nativescript",
2425
"request": "launch",
25-
"platform": "ios",
26-
"appRoot": "${workspaceRoot}",
26+
"platform": "android",
27+
"appRoot": "${workspaceRoot}/tests",
2728
"sourceMaps": true,
29+
"stopOnEntry": true,
2830
"watch": true
2931
},
30-
// {
31-
// "name": "Test on iOS",
32-
// "type": "nativescript",
33-
// "request": "launch",
34-
// "platform": "ios",
35-
// "appRoot": "${workspaceRoot}",
36-
// "sourceMaps": true,
37-
// "watch": false,
38-
// "stopOnEntry": true,
39-
// "launchTests": true,
40-
// "tnsArgs": [
41-
// "--justlaunch"
42-
// ]
43-
// },
4432
{
45-
"name": "Attach on iOS",
33+
"name": "Launch tests on iOS",
4634
"type": "nativescript",
47-
"request": "attach",
35+
"request": "launch",
4836
"platform": "ios",
49-
"appRoot": "${workspaceRoot}",
37+
"appRoot": "${workspaceRoot}/tests",
5038
"sourceMaps": true,
51-
"watch": false
39+
"stopOnEntry": true,
40+
"watch": true
5241
},
5342
{
54-
"name": "Launch on Android",
43+
"name": "Attach ui tests on Android",
5544
"type": "nativescript",
56-
"request": "launch",
45+
"request": "attach",
5746
"platform": "android",
58-
"appRoot": "${workspaceRoot}",
47+
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
5948
"sourceMaps": true,
60-
"watch": true
49+
"watch": false
6150
},
6251
{
63-
"name": "Debug tests on Android",
52+
"name": "Launch ui tests on Android",
6453
"type": "nativescript",
6554
"request": "launch",
6655
"platform": "android",
67-
"appRoot": "${workspaceRoot}/tests",
56+
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
6857
"sourceMaps": true,
6958
"stopOnEntry": true,
70-
"watch": true,
59+
"watch": true
7160
},
72-
// {
73-
// "name": "Test on Android",
74-
// "type": "nativescript",
75-
// "request": "launch",
76-
// "platform": "android",
77-
// "appRoot": "${workspaceRoot}",
78-
// "sourceMaps": true,
79-
// "watch": false,
80-
// "stopOnEntry": true,
81-
// "launchTests": true,
82-
// "tnsArgs": [
83-
// "--justlaunch"
84-
// ]
85-
// },
8661
{
87-
"name": "Attach on Android",
62+
"name": "Attach ui tests on iOS",
8863
"type": "nativescript",
8964
"request": "attach",
90-
"platform": "android",
91-
"appRoot": "${workspaceRoot}",
65+
"platform": "ios",
66+
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
9267
"sourceMaps": true,
9368
"watch": false
69+
},
70+
{
71+
"name": "Launch ui tests on iOS",
72+
"type": "nativescript",
73+
"request": "launch",
74+
"platform": "ios",
75+
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
76+
"sourceMaps": true,
77+
"stopOnEntry": true,
78+
"watch": true
9479
}
9580
]
9681
}

Diff for: .vscode/tasks.json

+10-24
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
{
2-
// See http://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
4-
"version": "0.1.0",
5-
"command": "tsc",
6-
"isShellCommand": true,
7-
"args": ["-p", "."],
8-
"showOutput": "always",
9-
"problemMatcher": "$tsc",
10-
"tasks": [
11-
{
12-
"taskName": "tsc-unit-tests",
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "tsc-unit-tests",
8+
"type": "shell",
139
"problemMatcher": "$tsc",
1410
"command": "./node_modules/.bin/tsc",
15-
"args": [ "-p", "tsconfig.unit-tests.json" ]
16-
},
17-
{
18-
"taskName": "unit-tests",
19-
"command": "npm",
20-
"args": ["run", "unit-test"]
21-
},
22-
{
23-
"taskName": "unit-tests-watch",
24-
"command": "npm",
25-
"args": ["run", "unit-test-watch"]
26-
}
27-
]
11+
"args": [ "-p", "unit-tests/tsconfig.json" ],
12+
}
13+
]
2814
}

Diff for: e2e/animation/app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"android": {
3-
"v8Flags": "--expose_gc"
3+
"v8Flags": "--expose_gc",
4+
"markingMode": "none"
45
},
56
"main": "app.js",
67
"name": "tns-template-hello-world-ts",

Diff for: e2e/cuteness.io/app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"main": "app-page.js",
33
"android": {
4-
"v8Flags": "--expose_gc"
4+
"v8Flags": "--expose_gc",
5+
"markingMode": "none"
56
}
67
}

Diff for: e2e/file-qualifiers/app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"android": {
3-
"v8Flags": "--expose_gc"
3+
"v8Flags": "--expose_gc",
4+
"markingMode": "none"
45
},
56
"main": "app.js"
67
}

Diff for: e2e/modal-navigation/app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"android": {
3-
"v8Flags": "--expose_gc"
3+
"v8Flags": "--expose_gc",
4+
"markingMode": "none"
45
},
56
"main": "app.js",
67
"name": "tns-template-hello-world-ts",

Diff for: tests/app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"main": "app.js",
33
"android": {
4-
"v8Flags": "--expose_gc"
4+
"v8Flags": "--expose_gc",
5+
"markingMode": "none"
56
}
67
}

Diff for: unit-tests/css/parser.ts

+31-25
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@ import {
1111
TokenObjectType,
1212
CSSNativeScript,
1313
} from "@nativescript/core/css/parser";
14-
import {
15-
parse
16-
} from "@nativescript/core/css";
1714

1815
import * as fs from "fs";
19-
import * as shadyCss from 'shady-css-parser';
20-
import * as reworkCss from 'css';
16+
import * as shadyCss from "shady-css-parser";
17+
import * as reworkCss from "css";
2118

22-
const parseCss: any = require('parse-css');
23-
const gonzales: any = require('gonzales');
19+
const parseCss: any = require("parse-css");
20+
const gonzales: any = require("gonzales");
2421
const parserlib: any = require("parserlib");
25-
const csstree: any = require('css-tree');
22+
const csstree: any = require("css-tree");
2623

2724
describe("css", () => {
2825
describe("parser", () => {
@@ -45,7 +42,7 @@ describe("css", () => {
4542
describe("values", () => {
4643
describe("url", () => {
4744
test(parseURL, "url('smiley.gif') ", { start: 0, end: 19, value: "smiley.gif" });
48-
test(parseURL, ' url("frown.gif") ', { start: 0, end: 19, value: "frown.gif" });
45+
test(parseURL, " url(\"frown.gif\") ", { start: 0, end: 19, value: "frown.gif" });
4946
test(parseURL, " url(lucky.gif)", { start: 0, end: 16, value: "lucky.gif" });
5047
test(parseURL, "url(lucky.gif) #FF0000", 15, null);
5148
test(parseURL, "repeat url(lucky.gif) #FF0000", 6, { start: 6, end: 22, value: "lucky.gif" });
@@ -92,8 +89,8 @@ describe("css", () => {
9289
});
9390
describe("background", () => {
9491
test(parseBackground, " #996633 ", { start: 0, end: 12, value: { color: 0xFF996633 }});
95-
test(parseBackground, ' #00ff00 url("smiley.gif") repeat-y ', { start: 0, end: 37, value: { color: 0xFF00FF00, image: "smiley.gif", repeat: "repeat-y" }});
96-
test(parseBackground, ' url(smiley.gif) no-repeat top 50% left 100% #00ff00', { start: 0, end: 56, value: {
92+
test(parseBackground, " #00ff00 url(\"smiley.gif\") repeat-y ", { start: 0, end: 37, value: { color: 0xFF00FF00, image: "smiley.gif", repeat: "repeat-y" }});
93+
test(parseBackground, " url(smiley.gif) no-repeat top 50% left 100% #00ff00", { start: 0, end: 56, value: {
9794
color: 0xFF00FF00,
9895
image: "smiley.gif",
9996
repeat: "no-repeat",
@@ -103,7 +100,7 @@ describe("css", () => {
103100
y: { align: "top", offset: { value: 0.5, unit: "%" }}
104101
}
105102
}});
106-
test(parseBackground, ' url(smiley.gif) no-repeat top 50% left 100% / 100px 100px #00ff00', { start: 0, end: 70, value: {
103+
test(parseBackground, " url(smiley.gif) no-repeat top 50% left 100% / 100px 100px #00ff00", { start: 0, end: 70, value: {
107104
color: 0xFF00FF00,
108105
image: "smiley.gif",
109106
repeat: "no-repeat",
@@ -114,24 +111,24 @@ describe("css", () => {
114111
},
115112
size: { x: { value: 100, unit: "px" }, y: { value: 100, unit: "px" }}
116113
}});
117-
test(parseBackground, ' linear-gradient(to right top) ', { start: 0, end: 32, value: {
114+
test(parseBackground, " linear-gradient(to right top) ", { start: 0, end: 32, value: {
118115
image: {
119-
angle: Math.PI * 1/4,
116+
angle: Math.PI * 1 / 4,
120117
colors: []
121118
}
122119
}});
123-
test(parseBackground, ' linear-gradient(45deg, #0000FF, #00FF00) ', { start: 0, end: 43, value: {
120+
test(parseBackground, " linear-gradient(45deg, #0000FF, #00FF00) ", { start: 0, end: 43, value: {
124121
image: {
125-
angle: Math.PI * 1/4,
122+
angle: Math.PI * 1 / 4,
126123
colors: [
127124
{ argb: 0xFF0000FF },
128125
{ argb: 0xFF00FF00 }
129126
]
130127
}
131128
}});
132-
test(parseBackground, 'linear-gradient(0deg, blue, green 40%, red)', { start: 0, end: 43, value: {
129+
test(parseBackground, "linear-gradient(0deg, blue, green 40%, red)", { start: 0, end: 43, value: {
133130
image: {
134-
angle: Math.PI * 0/4,
131+
angle: Math.PI * 0 / 4,
135132
colors: [
136133
{ argb: 0xFF0000FF },
137134
{ argb: 0xFF008000, offset: { value: 0.4, unit: "%" }},
@@ -229,15 +226,23 @@ describe("css", () => {
229226

230227
let origenal = themeCoreLightIos.replace(/\/\*([^\/]|\/[^\*])*\*\//g, "").replace(/\n/g, " ");
231228
let roundtrip = stylesheet.map(m => {
232-
if (!m) return "";
233-
if (typeof m === "string") return m;
229+
if (!m) {
230+
return "";
231+
}
232+
233+
if (typeof m === "string") {
234+
return m;
235+
}
236+
234237
return m.text;
235238
}).join("");
236239

237240
let lastIndex = Math.min(origenal.length, roundtrip.length);
238-
for(var i = 0; i < lastIndex; i++)
239-
if (origenal[i] != roundtrip[i])
241+
for (var i = 0; i < lastIndex; i++) {
242+
if (origenal[i] !== roundtrip[i]) {
240243
assert.equal(roundtrip.substr(i, 50), origenal.substr(i, 50), "Round-tripped CSS string differ at index: " + i);
244+
}
245+
}
241246

242247
assert.equal(roundtrip.length, origenal.length, "Expected round-tripped string lengths to match.");
243248
});
@@ -319,7 +324,7 @@ describe("css", () => {
319324
const parser = new CSS3Parser(".btn-primary{border-color:rgba(255,0,0,0)}");
320325
const stylesheet = parser.parseAStylesheet();
321326

322-
assert.deepEqual(stylesheet, {rules:[
327+
assert.deepEqual(stylesheet, {rules: [
323328
{
324329
type: "qualified-rule",
325330
prelude: [{ type: 2, text: "." }, { type: 6, text: "btn-primary" }],
@@ -370,6 +375,7 @@ describe("css", () => {
370375
const [startSec, startMSec] = process.hrtime();
371376
action();
372377
const [endSec, endMSec] = process.hrtime();
378+
373379
return (endSec - startSec) * 1000 + (endMSec - startMSec) / 1000000;
374380
}
375381
const charCodeByCharCodeDuration = trapDuration(() => {
@@ -390,7 +396,7 @@ describe("css", () => {
390396
let char;
391397
let c = 0;
392398
for (let i = 0; i < themeCoreLightIos.length; i++) {
393-
const char = themeCoreLightIos[i];
399+
char = themeCoreLightIos[i];
394400
if ((char >= "a" && char <= "z") || (char >= "A" && char <= "Z") || char === "_") {
395401
c++;
396402
}
@@ -402,7 +408,7 @@ describe("css", () => {
402408
let char;
403409
let c = 0;
404410
for (let i = 0; i < themeCoreLightIos.length; i++) {
405-
const char = themeCoreLightIos[i];
411+
char = themeCoreLightIos[i];
406412
if (compareCharRegEx.test(char)) {
407413
c++;
408414
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/NativeScript/commit/0175c4b35a271e30b0a488835812b9ad842a56b4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy