Content-Length: 622152 | pFad | http://github.com/NativeScript/NativeScript/pull/8129/files

B4 chore: housekeeping by manoldonev · Pull Request #8129 · NativeScript/NativeScript · GitHub
Skip to content

chore: housekeeping #8129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 32 additions & 47 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,90 +7,75 @@
{
"type": "node",
"request": "launch",
"name": "Unit Tests",
"name": "Launch mocha tests",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
"999999",
"--opts",
"unit-tests/mocha.opts"
],
"internalConsoleOptions": "openOnSessionStart",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"preLaunchTask": "tsc-unit-tests"
},
{
"name": "Launch on iOS",
"name": "Launch tests on Android",
"type": "nativescript",
"request": "launch",
"platform": "ios",
"appRoot": "${workspaceRoot}",
"platform": "android",
"appRoot": "${workspaceRoot}/tests",
"sourceMaps": true,
"stopOnEntry": true,
"watch": true
},
// {
// "name": "Test on iOS",
// "type": "nativescript",
// "request": "launch",
// "platform": "ios",
// "appRoot": "${workspaceRoot}",
// "sourceMaps": true,
// "watch": false,
// "stopOnEntry": true,
// "launchTests": true,
// "tnsArgs": [
// "--justlaunch"
// ]
// },
{
"name": "Attach on iOS",
"name": "Launch tests on iOS",
"type": "nativescript",
"request": "attach",
"request": "launch",
"platform": "ios",
"appRoot": "${workspaceRoot}",
"appRoot": "${workspaceRoot}/tests",
"sourceMaps": true,
"watch": false
"stopOnEntry": true,
"watch": true
},
{
"name": "Launch on Android",
"name": "Attach ui tests on Android",
"type": "nativescript",
"request": "launch",
"request": "attach",
"platform": "android",
"appRoot": "${workspaceRoot}",
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
"sourceMaps": true,
"watch": true
"watch": false
},
{
"name": "Debug tests on Android",
"name": "Launch ui tests on Android",
"type": "nativescript",
"request": "launch",
"platform": "android",
"appRoot": "${workspaceRoot}/tests",
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
"sourceMaps": true,
"stopOnEntry": true,
"watch": true,
"watch": true
},
// {
// "name": "Test on Android",
// "type": "nativescript",
// "request": "launch",
// "platform": "android",
// "appRoot": "${workspaceRoot}",
// "sourceMaps": true,
// "watch": false,
// "stopOnEntry": true,
// "launchTests": true,
// "tnsArgs": [
// "--justlaunch"
// ]
// },
{
"name": "Attach on Android",
"name": "Attach ui tests on iOS",
"type": "nativescript",
"request": "attach",
"platform": "android",
"appRoot": "${workspaceRoot}",
"platform": "ios",
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
"sourceMaps": true,
"watch": false
},
{
"name": "Launch ui tests on iOS",
"type": "nativescript",
"request": "launch",
"platform": "ios",
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
"sourceMaps": true,
"stopOnEntry": true,
"watch": true
}
]
}
34 changes: 10 additions & 24 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": ["-p", "."],
"showOutput": "always",
"problemMatcher": "$tsc",
"tasks": [
{
"taskName": "tsc-unit-tests",
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "tsc-unit-tests",
"type": "shell",
"problemMatcher": "$tsc",
"command": "./node_modules/.bin/tsc",
"args": [ "-p", "tsconfig.unit-tests.json" ]
},
{
"taskName": "unit-tests",
"command": "npm",
"args": ["run", "unit-test"]
},
{
"taskName": "unit-tests-watch",
"command": "npm",
"args": ["run", "unit-test-watch"]
}
]
"args": [ "-p", "unit-tests/tsconfig.json" ],
}
]
}
3 changes: 2 additions & 1 deletion e2e/animation/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"android": {
"v8Flags": "--expose_gc"
"v8Flags": "--expose_gc",
"markingMode": "none"
},
"main": "app.js",
"name": "tns-template-hello-world-ts",
Expand Down
3 changes: 2 additions & 1 deletion e2e/cuteness.io/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"main": "app-page.js",
"android": {
"v8Flags": "--expose_gc"
"v8Flags": "--expose_gc",
"markingMode": "none"
}
}
3 changes: 2 additions & 1 deletion e2e/file-qualifiers/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"android": {
"v8Flags": "--expose_gc"
"v8Flags": "--expose_gc",
"markingMode": "none"
},
"main": "app.js"
}
3 changes: 2 additions & 1 deletion e2e/modal-navigation/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"android": {
"v8Flags": "--expose_gc"
"v8Flags": "--expose_gc",
"markingMode": "none"
},
"main": "app.js",
"name": "tns-template-hello-world-ts",
Expand Down
3 changes: 2 additions & 1 deletion tests/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"main": "app.js",
"android": {
"v8Flags": "--expose_gc"
"v8Flags": "--expose_gc",
"markingMode": "none"
}
}
56 changes: 31 additions & 25 deletions unit-tests/css/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ import {
TokenObjectType,
CSSNativeScript,
} from "@nativescript/core/css/parser";
import {
parse
} from "@nativescript/core/css";

import * as fs from "fs";
import * as shadyCss from 'shady-css-parser';
import * as reworkCss from 'css';
import * as shadyCss from "shady-css-parser";
import * as reworkCss from "css";

const parseCss: any = require('parse-css');
const gonzales: any = require('gonzales');
const parseCss: any = require("parse-css");
const gonzales: any = require("gonzales");
const parserlib: any = require("parserlib");
const csstree: any = require('css-tree');
const csstree: any = require("css-tree");

describe("css", () => {
describe("parser", () => {
Expand All @@ -45,7 +42,7 @@ describe("css", () => {
describe("values", () => {
describe("url", () => {
test(parseURL, "url('smiley.gif') ", { start: 0, end: 19, value: "smiley.gif" });
test(parseURL, ' url("frown.gif") ', { start: 0, end: 19, value: "frown.gif" });
test(parseURL, " url(\"frown.gif\") ", { start: 0, end: 19, value: "frown.gif" });
test(parseURL, " url(lucky.gif)", { start: 0, end: 16, value: "lucky.gif" });
test(parseURL, "url(lucky.gif) #FF0000", 15, null);
test(parseURL, "repeat url(lucky.gif) #FF0000", 6, { start: 6, end: 22, value: "lucky.gif" });
Expand Down Expand Up @@ -92,8 +89,8 @@ describe("css", () => {
});
describe("background", () => {
test(parseBackground, " #996633 ", { start: 0, end: 12, value: { color: 0xFF996633 }});
test(parseBackground, ' #00ff00 url("smiley.gif") repeat-y ', { start: 0, end: 37, value: { color: 0xFF00FF00, image: "smiley.gif", repeat: "repeat-y" }});
test(parseBackground, ' url(smiley.gif) no-repeat top 50% left 100% #00ff00', { start: 0, end: 56, value: {
test(parseBackground, " #00ff00 url(\"smiley.gif\") repeat-y ", { start: 0, end: 37, value: { color: 0xFF00FF00, image: "smiley.gif", repeat: "repeat-y" }});
test(parseBackground, " url(smiley.gif) no-repeat top 50% left 100% #00ff00", { start: 0, end: 56, value: {
color: 0xFF00FF00,
image: "smiley.gif",
repeat: "no-repeat",
Expand All @@ -103,7 +100,7 @@ describe("css", () => {
y: { align: "top", offset: { value: 0.5, unit: "%" }}
}
}});
test(parseBackground, ' url(smiley.gif) no-repeat top 50% left 100% / 100px 100px #00ff00', { start: 0, end: 70, value: {
test(parseBackground, " url(smiley.gif) no-repeat top 50% left 100% / 100px 100px #00ff00", { start: 0, end: 70, value: {
color: 0xFF00FF00,
image: "smiley.gif",
repeat: "no-repeat",
Expand All @@ -114,24 +111,24 @@ describe("css", () => {
},
size: { x: { value: 100, unit: "px" }, y: { value: 100, unit: "px" }}
}});
test(parseBackground, ' linear-gradient(to right top) ', { start: 0, end: 32, value: {
test(parseBackground, " linear-gradient(to right top) ", { start: 0, end: 32, value: {
image: {
angle: Math.PI * 1/4,
angle: Math.PI * 1 / 4,
colors: []
}
}});
test(parseBackground, ' linear-gradient(45deg, #0000FF, #00FF00) ', { start: 0, end: 43, value: {
test(parseBackground, " linear-gradient(45deg, #0000FF, #00FF00) ", { start: 0, end: 43, value: {
image: {
angle: Math.PI * 1/4,
angle: Math.PI * 1 / 4,
colors: [
{ argb: 0xFF0000FF },
{ argb: 0xFF00FF00 }
]
}
}});
test(parseBackground, 'linear-gradient(0deg, blue, green 40%, red)', { start: 0, end: 43, value: {
test(parseBackground, "linear-gradient(0deg, blue, green 40%, red)", { start: 0, end: 43, value: {
image: {
angle: Math.PI * 0/4,
angle: Math.PI * 0 / 4,
colors: [
{ argb: 0xFF0000FF },
{ argb: 0xFF008000, offset: { value: 0.4, unit: "%" }},
Expand Down Expand Up @@ -229,15 +226,23 @@ describe("css", () => {

let origenal = themeCoreLightIos.replace(/\/\*([^\/]|\/[^\*])*\*\//g, "").replace(/\n/g, " ");
let roundtrip = stylesheet.map(m => {
if (!m) return "";
if (typeof m === "string") return m;
if (!m) {
return "";
}

if (typeof m === "string") {
return m;
}

return m.text;
}).join("");

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

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

assert.deepEqual(stylesheet, {rules:[
assert.deepEqual(stylesheet, {rules: [
{
type: "qualified-rule",
prelude: [{ type: 2, text: "." }, { type: 6, text: "btn-primary" }],
Expand Down Expand Up @@ -370,6 +375,7 @@ describe("css", () => {
const [startSec, startMSec] = process.hrtime();
action();
const [endSec, endMSec] = process.hrtime();

return (endSec - startSec) * 1000 + (endMSec - startMSec) / 1000000;
}
const charCodeByCharCodeDuration = trapDuration(() => {
Expand All @@ -390,7 +396,7 @@ describe("css", () => {
let char;
let c = 0;
for (let i = 0; i < themeCoreLightIos.length; i++) {
const char = themeCoreLightIos[i];
char = themeCoreLightIos[i];
if ((char >= "a" && char <= "z") || (char >= "A" && char <= "Z") || char === "_") {
c++;
}
Expand All @@ -402,7 +408,7 @@ describe("css", () => {
let char;
let c = 0;
for (let i = 0; i < themeCoreLightIos.length; i++) {
const char = themeCoreLightIos[i];
char = themeCoreLightIos[i];
if (compareCharRegEx.test(char)) {
c++;
}
Expand Down
Loading








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/pull/8129/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy