Fix some broken code snippets

This commit is contained in:
Erjan Gavalji
2016-09-29 15:55:55 +03:00
parent eb8d2f1542
commit 83536573d8
3 changed files with 6 additions and 6 deletions

View File

@@ -39,5 +39,5 @@ export var test_DummyTestForSnippetOnly4 = function () {
export var test_DummyTestForSnippetOnly5 = function () {
// >> console-trace
console.trace();
// << console-traceß
// << console-trace
}

View File

@@ -111,7 +111,7 @@ export var test_ObservableArray_joinShouldReturnStringWithAllItemsSeparatedWithD
};
export var test_ObservableArray_popShouldRemoveTheLastElement = function () {
// >> observable-array-join-pop'
// >> observable-array-join-pop
var array = new observableArrayModule.ObservableArray([1, 2, 3]);
// >> (hide)
var bindable = new bindableModule.Bindable();
@@ -119,7 +119,7 @@ export var test_ObservableArray_popShouldRemoveTheLastElement = function () {
bindable.bind({ sourceProperty: "length", targetProperty: "testProperty" }, array);
// << (hide)
var result = array.pop();
// << observable-array-join-pop'
// << observable-array-join-pop
TKUnit.assert(result === 3 && array.length === 2, "ObservableArray pop() should remove last element!");
TKUnit.assert(bindable.get("testProperty") === array.length, "Expected: " + array.length + ", Actual: " + bindable.get("testProperty"));
};
@@ -359,7 +359,7 @@ export var test_ObservableArray_spliceShouldRemoveSpecifiedNumberOfElementsStart
bindable.bind({ sourceProperty: "length", targetProperty: "testProperty" }, array);
// << (hide)
var result = array.splice(1, 2);
// <, observable-array-splice
// << observable-array-splice
TKUnit.assert(result.length === 2 && result[0] === "two" && array.length === 1 && array.getItem(0) === "one",
"ObservableArray splice() should remove specified number of elements starting from specified index!");
TKUnit.assert(bindable.get("testProperty") === array.length, "Expected: " + array.length + ", Actual: " + bindable.get("testProperty"));

View File

@@ -24,7 +24,7 @@ export var test_fetch = function (done: (err: Error, res?: string) => void) {
};
export var test_fetch_text = function (done: (err: Error, res?: string) => void) {
// >> fetch-string'
// >> fetch-string
fetch("https://httpbin.org/get").then(response => { return response.text(); }).then(function (r) {
// Argument (r) is string!
// >> (hide)
@@ -37,7 +37,7 @@ export var test_fetch_text = function (done: (err: Error, res?: string) => void)
done(e);
// << (hide)
});
// << fetch-string'
// << fetch-string
};
export var test_fetch_json = function (done: (err: Error, res?: string) => void) {