Tests moved into separate folders (#3794)

Fix android crash on application exit
This commit is contained in:
Hristo Hristov
2017-03-15 12:26:54 +02:00
committed by GitHub
parent 58ab01870d
commit 7b5ef052fd
50 changed files with 258 additions and 120 deletions

View File

@@ -0,0 +1,36 @@
export var test_DummyTestForSnippetOnly0 = function () {
// >> console-log
console.log("Hello, world!");
console.info("I am NativeScript");
console.warn("Low memory");
console.error("Uncaught Application Exception");
// << console-log
}
export var test_DummyTestForSnippetOnly1 = function () {
// >> console-time
console.time("LoadTime");
// << console-time
// >> console-timeend
console.timeEnd("LoadTime");
// << console-timeend
}
export var test_DummyTestForSnippetOnly2 = function () {
// >> console-assert
console.assert(2 === 2, "2 equals 2");
// << console-assert
}
export var test_DummyTestForSnippetOnly3 = function () {
// >> console-dir
var obj = {name: "John", age: 34};
console.dir(obj);
// << console-dir
}
export var test_DummyTestForSnippetOnly5 = function () {
// >> console-trace
console.trace();
// << console-trace
}

View File

@@ -0,0 +1,35 @@
---
nav-title: "console How-To"
title: "console"
environment: nativescript
description: "Examples for using console"
previous_url: /ApiReference/console/HOW-TO
---
# Console
### Logging
Logging to the console does not require the "console" module since the console variable is global. It can be used anywhere within your code.
You can log your message in several different categories.
{%snippet console-log%}
### Time
Begins counting a time span for a given name (key).
{%snippet console-time%}
Ends a previously started time span through the time method.
{%snippet console-timeend%}
### Assert
Asserts a boolean condition and prints a message in case the assert fails.
{%snippet console-assert%}
### Dir
Prints the state of the specified object to the console.
{%snippet console-dir%}
### Dump
Prints the state of the specified object to the console.
{%snippet console-dump%}
### Trace
Prints the current stack trace in the console.
{%snippet console-trace%}