summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskaegi <simon_kaegi@ca.ibm.com>2014-02-17 23:38:29 -0500
committerskaegi <simon_kaegi@ca.ibm.com>2014-02-17 23:38:29 -0500
commit38ae2f43f10ae8474a6b7c3e4de04d34532d1145 (patch)
tree6460965f0691ef0d65f9b7e0efb6b51002ce5561
parent3cb91032ae5b3930778bc8c25f1e9fc2235aa3da (diff)
downloadorg.eclipse.orion.client-origin/move_to_chai.zip
org.eclipse.orion.client-origin/move_to_chai.tar.gz
org.eclipse.orion.client-origin/move_to_chai.tar.bz2
moving to chai from orion/assertorigin/move_to_chai
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/test.js3
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/js-tests/editor/contentAssist/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/js-tests/editor/mockTextView.js3
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-annotationModel.js4
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-model.js4
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-projectionModel.js4
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-codemirror.js5
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-editor.js5
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/js-tests/editor/textMateStyler/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/astManagerTests.js5
-rw-r--r--bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/contentAssistTests.js5
-rw-r--r--bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/eslintEventTests.js5
-rw-r--r--bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/finderTests.js189
-rw-r--r--bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/indexFileParsingTests.js5
-rw-r--r--bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js11
-rw-r--r--bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/outlinerTests.js75
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/HTMLTemplates/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/URITemplate/testcase.js8
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/URL-old/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/URL/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/asyncStyler/testcase.js9
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/base64/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/charDiff/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/commands/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/commonjs-unittesting/test.html4
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/compare/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/config/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/contentTypes/contentTypesTests.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/dispatcher/editDispatcherTests.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/encoding/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/extensionParsing/testcase.js6
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/fileapi/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/githubfileapi/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/globalSearch/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/i18n/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/metatype/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/objects/testcase.js6
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/pageUtil/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/pluginRegistry/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/preferences/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/searchCrawler/testcase.js4
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/searchRendering/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/serviceRegistry/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/serviceTracker/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/settings/testcase.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/testOrionDeferred/testcase.js4
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/testRunAsynch/testcase.js344
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/typedefs/typedefsTestcase.js7
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/urlUtils/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/webdav/testcase.js3
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/js-tests/xhr/testcase.js5
51 files changed, 433 insertions, 392 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/test.js b/bundles/org.eclipse.orion.client.core/web/orion/test.js
index 4804f79..18a0687 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/test.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/test.js
@@ -13,10 +13,9 @@
define([
'orion/Deferred',
- 'orion/assert',
'orion/EventTarget',
'require'
-], function(Deferred, assert, EventTarget, require) {
+], function(Deferred, EventTarget, require) {
// Time to wait before declaring an async test failed. A test function can override this by defining a 'timeout' property.
var DEFAULT_TIMEOUT = 30000;
diff --git a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/contentAssist/testcase.js b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/contentAssist/testcase.js
index df6b118..f2f550e 100644
--- a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/contentAssist/testcase.js
+++ b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/contentAssist/testcase.js
@@ -11,11 +11,12 @@
/*global define setTimeout*/
define([
'orion/Deferred',
- 'orion/assert',
+ 'chai/chai',
'orion/editor/textModel',
'js-tests/editor/mockTextView',
'orion/editor/contentAssist'
-], function(Deferred, assert, mTextModel, mMockTextView, mContentAssist) {
+], function(Deferred, chai, mTextModel, mMockTextView, mContentAssist) {
+ var assert = chai.assert;
var ContentAssist = mContentAssist.ContentAssist,
TextModel = mTextModel.TextModel,
MockTextView = mMockTextView.MockTextView;
diff --git a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/mockTextView.js b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/mockTextView.js
index bade3fc..f479e02 100644
--- a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/mockTextView.js
+++ b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/mockTextView.js
@@ -13,13 +13,12 @@
/*global define*/
define([
- "orion/assert",
"orion/editor/eventTarget",
"orion/editor/keyModes",
"orion/editor/textModel",
"orion/editor/annotations",
"orion/editor/mirror"
-], function(assert, mEventTarget, mKeyModes, mTextModel) {
+], function(mEventTarget, mKeyModes, mTextModel) {
function clone(obj) {
/*Note that this code only works because of the limited types used in TextViewOptions */
diff --git a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-annotationModel.js b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-annotationModel.js
index cd2da90..068c7e7 100644
--- a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-annotationModel.js
+++ b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-annotationModel.js
@@ -11,8 +11,8 @@
/*global define */
-define(["orion/assert", 'orion/editor/textModel', 'orion/editor/annotations'], function(assert, mTextModel, mAnnotations) {
-
+define(["chai/chai", 'orion/editor/textModel', 'orion/editor/annotations'], function(chai, mTextModel, mAnnotations) {
+ var assert = chai.assert;
var tests = {};
tests.testAnnotationModel1 = function () {
diff --git a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-model.js b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-model.js
index 980226c..47fe583 100644
--- a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-model.js
+++ b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-model.js
@@ -11,8 +11,8 @@
/*global define */
-define(["orion/assert", 'orion/editor/textModel', 'orion/editor/annotations'], function(assert, mTextModel) {
-
+define(["chai/chai", 'orion/editor/textModel', 'orion/editor/annotations'], function(chai, mTextModel) {
+ var assert = chai.assert;
var tests = {};
function assertEquals(msg, expected, actual) {
diff --git a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-projectionModel.js b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-projectionModel.js
index 0cd7f48..ba92bc5 100644
--- a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-projectionModel.js
+++ b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/test-projectionModel.js
@@ -11,8 +11,8 @@
/*global define */
-define(["orion/assert", 'orion/editor/textModel', 'orion/editor/projectionTextModel'], function(assert, mTextModel, mProjectionTextModel) {
-
+define(["chai/chai", 'orion/editor/textModel', 'orion/editor/projectionTextModel'], function(chai, mTextModel, mProjectionTextModel) {
+ var assert = chai.assert;
var tests = {};
function assertEquals(msg, expected, actual) {
diff --git a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-codemirror.js b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-codemirror.js
index 80c230a..7b9d424 100644
--- a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-codemirror.js
+++ b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-codemirror.js
@@ -12,8 +12,9 @@
/*jslint */
/*global define*/
-define(["orion/assert", "orion/editor/eventTarget", "orion/editor/textModel", "orion/editor/annotations", "orion/editor/mirror"],
- function(assert, mEventTarget, mTextModel, mAnnotations, mMirror) {
+define(["chai/chai", "orion/editor/eventTarget", "orion/editor/textModel", "orion/editor/annotations", "orion/editor/mirror"],
+ function(chai, mEventTarget, mTextModel, mAnnotations, mMirror) {
+ var assert = chai.assert;
var tests = {};
function SampleMode(codeMirror) {
diff --git a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-editor.js b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-editor.js
index d43587c..0444916 100644
--- a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-editor.js
+++ b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/testcase-editor.js
@@ -12,8 +12,9 @@
/*jslint */
/*global define*/
-define(["orion/assert", "orion/editor/editor"],
- function(assert, mEditor) {
+define(["chai/chai", "orion/editor/editor"],
+ function(chai, mEditor) {
+ var assert = chai.assert;
var tests = {};
// ************************************************************************************************
diff --git a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/textMateStyler/testcase.js b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/textMateStyler/testcase.js
index c1e3c9b..d085627 100644
--- a/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/textMateStyler/testcase.js
+++ b/bundles/org.eclipse.orion.client.editor/web/js-tests/editor/textMateStyler/testcase.js
@@ -12,8 +12,9 @@
/*jslint laxbreak:true regexp:false*/
/*global define eclipse */
-define(["orion/assert", "../mockTextView.js", "orion/editor/textMateStyler", "testGrammars.js"],
- function(assert, mMockTextView, mTextMateStyler, mTestGrammars) {
+define(["chai/chai", "../mockTextView.js", "orion/editor/textMateStyler", "testGrammars.js"],
+ function(chai, mMockTextView, mTextMateStyler, mTestGrammars) {
+ var assert = chai.assert;
var tests = {};
// TODO: run tests with both Windows and Linux delimiters since a few cases have failed with
diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/astManagerTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/astManagerTests.js
index 8111f6b..9ec11b8 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/astManagerTests.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/astManagerTests.js
@@ -11,9 +11,10 @@
/*global define esprima:true*/
define([
'javascript/astManager',
- 'orion/assert',
+ 'chai/chai',
'orion/Deferred',
-], function(ASTManager, assert, Deferred) {
+], function(ASTManager, chai, Deferred) {
+ var assert = chai.assert;
/**
* @name setup
diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/contentAssistTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/contentAssistTests.js
index 9d406b6..cc0c53b 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/contentAssistTests.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/contentAssistTests.js
@@ -15,13 +15,14 @@
define([
'javascript/contentAssist/contentAssist',
'javascript/contentAssist/indexer',
- 'orion/assert',
+ 'chai/chai',
'orion/objects',
'esprima',
'doctrine/doctrine',
'orion/Deferred',
'orion/editor/jsTemplateContentAssist' //TODO remove this once we merge the code
-], function(ContentAssist, Indexer, assert, objects, Esprima, Doctrine, Deferred, JSTemplateProposals) {
+], function(ContentAssist, Indexer, chai, objects, Esprima, Doctrine, Deferred, JSTemplateProposals) {
+ var assert = chai.assert;
/**
* @description Parse the snippet
diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/eslintEventTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/eslintEventTests.js
index eee0dfc..9d2e639 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/eslintEventTests.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/eslintEventTests.js
@@ -11,8 +11,9 @@
/*global console:true define*/
define([
'eslint/events',
- 'orion/assert'
-], function(events, assert) {
+ 'chai/chai'
+], function(events, chai) {
+ var assert = chai.assert;
var EventEmitter = events.EventEmitter;
/**
diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/finderTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/finderTests.js
index 3a9fd75..210eb7a 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/finderTests.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/finderTests.js
@@ -10,11 +10,12 @@
******************************************************************************/
/*global console:true define*/
define([
- 'orion/assert',
+ 'chai/chai',
'javascript/finder',
'javascript/astManager',
'orion/Deferred'
-], function(Assert, Finder, ASTManager, Deferred) {
+], function(chai, Finder, ASTManager, Deferred) {
+ var assert = chai.assert;
var astManager = new ASTManager.ASTManager();
var editorContext = {
@@ -58,97 +59,97 @@ define([
/***/
test_findWord1: function() {
var word = Finder.findWord('function(param1, param2)', 12);
- Assert.equal(word, 'param1', 'Should have found the word param1');
+ assert.equal(word, 'param1', 'Should have found the word param1');
},
/***/
test_findWord2: function() {
var word = Finder.findWord('function(param1, param2)', 9);
- Assert.equal(word, 'param1', 'Should have found the word param1');
+ assert.equal(word, 'param1', 'Should have found the word param1');
},
/***/
test_findWord3: function() {
var word = Finder.findWord('function(param1, param2)', 17);
- Assert.equal(word, 'param2', 'Should have found the word param2');
+ assert.equal(word, 'param2', 'Should have found the word param2');
},
/***/
test_findWord4: function() {
var word = Finder.findWord('var foo.bar = function(param1, param2)', 4);
- Assert.equal(word, 'foo', 'Should have found the word foo');
+ assert.equal(word, 'foo', 'Should have found the word foo');
},
/***/
test_findWord5: function() {
var word = Finder.findWord('var foo.bar = function(param1, param2)', 8);
- Assert.equal(word, 'bar', 'Should have found the word bar');
+ assert.equal(word, 'bar', 'Should have found the word bar');
},
/***/
test_findWord6: function() {
var word = Finder.findWord('f =function(p1) {', 3);
- Assert.equal(word, 'function', 'Should have found word function');
+ assert.equal(word, 'function', 'Should have found word function');
},
/***/
test_findWord7: function() {
var word = Finder.findWord('f ={foo:true', 4);
- Assert.equal(word, 'foo', 'Should have found word foo');
+ assert.equal(word, 'foo', 'Should have found word foo');
},
/***/
test_findWord8: function() {
var word = Finder.findWord('function(param1, param2)', 15);
- Assert.equal(word, 'param1', 'Should have found word param1');
+ assert.equal(word, 'param1', 'Should have found word param1');
},
/***/
test_findWord9: function() {
var word = Finder.findWord('var foo.bar = function(param1, param2)', 7);
- Assert.equal(word, 'foo', 'Should have found word foo');
+ assert.equal(word, 'foo', 'Should have found word foo');
},
/***/
test_findWord10: function() {
var word = Finder.findWord(' foo.bar = function(param1, param2)', 4);
- Assert.equal(word, 'foo', 'Should have found word foo');
+ assert.equal(word, 'foo', 'Should have found word foo');
},
/***/
test_findWord11: function() {
var word = Finder.findWord(' foo.bar = function(param1, param2)', 2);
- Assert.equal(word, 'foo', 'Should have found word foo');
+ assert.equal(word, 'foo', 'Should have found word foo');
},
/***/
test_findNoWord1: function() {
var word = Finder.findWord('f: function(p1, p2)', 2);
- Assert.equal(word, null, 'Should have found no word');
+ assert.equal(word, null, 'Should have found no word');
},
/***/
test_findNoWord2: function() {
var word = Finder.findWord('f: function(p1, p2)', 15);
- Assert.equal(word, null, 'Should have found no word');
+ assert.equal(word, null, 'Should have found no word');
},
/***/
test_findNoWord3: function() {
var word = Finder.findWord('f: function(p1) {', 16);
- Assert.equal(word, null, 'Should have found no word');
+ assert.equal(word, null, 'Should have found no word');
},
/***/
test_findNoWord4: function() {
var word = Finder.findWord('f: function(p1) {', 17);
- Assert.equal(word, null, 'Should have found no word');
+ assert.equal(word, null, 'Should have found no word');
},
/***/
test_findNoWord5: function() {
var word = Finder.findWord('f = function(p1) {', 2);
- Assert.equal(word, null, 'Should have found no word');
+ assert.equal(word, null, 'Should have found no word');
},
/***/
test_findNoWord6: function() {
var word = Finder.findWord('f = function(p1) {', 3);
- Assert.equal(word, null, 'Should have found no word');
+ assert.equal(word, null, 'Should have found no word');
},
/***/
test_findNoWord7: function() {
var word = Finder.findWord('var a = [1, 2]', 7);
- Assert.equal(word, null, 'Should have found no word');
+ assert.equal(word, null, 'Should have found no word');
},
/***/
test_findNoWord8: function() {
var word = Finder.findWord('var a = [1, 2]', 14);
- Assert.equal(word, null, 'Should have found no word');
+ assert.equal(word, null, 'Should have found no word');
},
/***/
test_findNode1: function() {
@@ -159,10 +160,10 @@ define([
return astManager.getAST(editorContext).then(function(ast) {
var node = Finder.findNode(9, ast);
if(!node) {
- Assert.fail("Should have found a node");
+ assert.fail("Should have found a node");
}
else {
- Assert.equal(node.type, 'FunctionDeclaration', 'Should have found a FunctionDeclaration node');
+ assert.equal(node.type, 'FunctionDeclaration', 'Should have found a FunctionDeclaration node');
}
});
}
@@ -179,10 +180,10 @@ define([
return astManager.getAST(editorContext).then(function(ast) {
var node = Finder.findNode(12, ast);
if(!node) {
- Assert.fail("Should have found a node");
+ assert.fail("Should have found a node");
}
else {
- Assert.equal(node.type, 'Identifier', 'Should have found a Identifier node');
+ assert.equal(node.type, 'Identifier', 'Should have found a Identifier node');
}
});
}
@@ -199,10 +200,10 @@ define([
return astManager.getAST(editorContext).then(function(ast) {
var node = Finder.findNode(14, ast);
if(!node) {
- Assert.fail("Should have found a node");
+ assert.fail("Should have found a node");
}
else {
- Assert.equal(node.type, 'Identifier', 'Should have found a Identifier node');
+ assert.equal(node.type, 'Identifier', 'Should have found a Identifier node');
}
});
}
@@ -220,10 +221,10 @@ define([
return astManager.getAST(editorContext).then(function(ast) {
var node = Finder.findNode(28, ast);
if(!node) {
- Assert.fail("Should have found a node");
+ assert.fail("Should have found a node");
}
else {
- Assert.equal(node.type, 'Identifier', 'Should have found a Identifier node');
+ assert.equal(node.type, 'Identifier', 'Should have found a Identifier node');
}
});
}
@@ -240,11 +241,11 @@ define([
try {
var token = Finder.findToken(0, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Punctuator', 'Should have found a Punctuator token');
- Assert.equal(token.value, '(', 'Should have found a ( token');
+ assert.equal(token.type, 'Punctuator', 'Should have found a Punctuator token');
+ assert.equal(token.value, '(', 'Should have found a ( token');
}
}
finally {
@@ -263,11 +264,11 @@ define([
try {
var token = Finder.findToken(4, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
- Assert.equal(token.value, 'function', 'Should have found a function token');
+ assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
+ assert.equal(token.value, 'function', 'Should have found a function token');
}
}
finally {
@@ -286,11 +287,11 @@ define([
try {
var token = Finder.findToken(21, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Punctuator', 'Should have found a Punctuator token');
- Assert.equal(token.value, '}', 'Should have found a } token');
+ assert.equal(token.type, 'Punctuator', 'Should have found a Punctuator token');
+ assert.equal(token.value, '}', 'Should have found a } token');
}
}
finally {
@@ -309,11 +310,11 @@ define([
try {
var token = Finder.findToken(1, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
- Assert.equal(token.value, 'var', 'Should have found a var token');
+ assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
+ assert.equal(token.value, 'var', 'Should have found a var token');
}
}
finally {
@@ -332,11 +333,11 @@ define([
try {
var token = Finder.findToken(12, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Punctuator', 'Should have found a Punctuator token');
- Assert.equal(token.value, '/', 'Should have found a / token');
+ assert.equal(token.type, 'Punctuator', 'Should have found a Punctuator token');
+ assert.equal(token.value, '/', 'Should have found a / token');
}
}
finally {
@@ -355,11 +356,11 @@ define([
try {
var token = Finder.findToken(1, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
- Assert.equal(token.value, 'var', 'Should have found a var token');
+ assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
+ assert.equal(token.value, 'var', 'Should have found a var token');
}
}
finally {
@@ -378,11 +379,11 @@ define([
try {
var token = Finder.findToken(7, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
- Assert.equal(token.value, 'function', 'Should have found a function token');
+ assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
+ assert.equal(token.value, 'function', 'Should have found a function token');
}
}
finally {
@@ -401,11 +402,11 @@ define([
try {
var token = Finder.findToken(18, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
- Assert.equal(token.value, 'function', 'Should have found a function token');
+ assert.equal(token.type, 'Keyword', 'Should have found a Keyword token');
+ assert.equal(token.value, 'function', 'Should have found a function token');
}
}
finally {
@@ -423,7 +424,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(-1, ast.tokens);
- Assert.equal(token, null, "Should not have found a token for out of range");
+ assert.equal(token, null, "Should not have found a token for out of range");
}
finally {
astManager.updated();
@@ -441,11 +442,11 @@ define([
try {
var token = Finder.findToken(9, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Identifier', 'Should have found an Identifier token');
- Assert.equal(token.value, 'f', 'Should have found a f token');
+ assert.equal(token.type, 'Identifier', 'Should have found an Identifier token');
+ assert.equal(token.value, 'f', 'Should have found a f token');
}
}
finally {
@@ -464,11 +465,11 @@ define([
try {
var token = Finder.findToken(8, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Punctuator', 'Should have found an Punctuator token');
- Assert.equal(token.value, '=', 'Should have found a = token');
+ assert.equal(token.type, 'Punctuator', 'Should have found an Punctuator token');
+ assert.equal(token.value, '=', 'Should have found a = token');
}
}
finally {
@@ -487,11 +488,11 @@ define([
try {
var token = Finder.findToken(11, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Identifier', 'Should have found an Identifier token');
- Assert.equal(token.value, 'f', 'Should have found a f token');
+ assert.equal(token.type, 'Identifier', 'Should have found an Identifier token');
+ assert.equal(token.value, 'f', 'Should have found a f token');
}
}
finally {
@@ -510,11 +511,11 @@ define([
try {
var token = Finder.findToken(14, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Keyword', 'Should have found an Keyword token');
- Assert.equal(token.value, 'function', 'Should have found a function token');
+ assert.equal(token.type, 'Keyword', 'Should have found an Keyword token');
+ assert.equal(token.value, 'function', 'Should have found a function token');
}
}
finally {
@@ -533,11 +534,11 @@ define([
try {
var token = Finder.findToken(18, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Keyword', 'Should have found an Keyword token');
- Assert.equal(token.value, 'function', 'Should have found a function token');
+ assert.equal(token.type, 'Keyword', 'Should have found an Keyword token');
+ assert.equal(token.value, 'function', 'Should have found a function token');
}
}
finally {
@@ -556,11 +557,11 @@ define([
try {
var token = Finder.findToken(23, ast.tokens);
if(!token) {
- Assert.fail("Should have found a token");
+ assert.fail("Should have found a token");
}
else {
- Assert.equal(token.type, 'Punctuator', 'Should have found an Punctuator token');
- Assert.equal(token.value, ')', 'Should have found a ) token');
+ assert.equal(token.type, 'Punctuator', 'Should have found an Punctuator token');
+ assert.equal(token.value, ')', 'Should have found a ) token');
}
}
finally {
@@ -578,7 +579,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(4, ast.tokens);
- Assert.equal(null, token, 'Should not have found a token');
+ assert.equal(null, token, 'Should not have found a token');
}
finally {
astManager.updated();
@@ -595,7 +596,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(5, ast.tokens);
- Assert.equal(null, token, 'Should not have found a token');
+ assert.equal(null, token, 'Should not have found a token');
}
finally {
astManager.updated();
@@ -612,7 +613,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(12, ast.tokens);
- Assert.equal(null, token, 'Should not have found a token');
+ assert.equal(null, token, 'Should not have found a token');
}
finally {
astManager.updated();
@@ -629,7 +630,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(14, ast.tokens);
- Assert.equal(null, token, 'Should not have found a token');
+ assert.equal(null, token, 'Should not have found a token');
}
finally {
astManager.updated();
@@ -646,7 +647,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(15, ast.tokens);
- Assert.equal(null, token, 'Should not have found a token');
+ assert.equal(null, token, 'Should not have found a token');
}
finally {
astManager.updated();
@@ -663,7 +664,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(1, ast.tokens);
- Assert.equal(null, token, 'Should not have found a token');
+ assert.equal(null, token, 'Should not have found a token');
}
finally {
astManager.updated();
@@ -680,7 +681,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(0, ast.tokens);
- Assert.equal(null, token, 'Should not have found a token');
+ assert.equal(null, token, 'Should not have found a token');
}
finally {
astManager.updated();
@@ -698,11 +699,11 @@ define([
try {
var token = Finder.findToken(17, ast.tokens);
if(!token) {
- Assert.fail('Should have found a token');
+ assert.fail('Should have found a token');
}
else {
- Assert.equal(token.type, 'Identifier', 'Should have found an Identifier token');
- Assert.equal(token.value, 'foo', 'Should have found a foo token');
+ assert.equal(token.type, 'Identifier', 'Should have found an Identifier token');
+ assert.equal(token.value, 'foo', 'Should have found a foo token');
}
}
finally {
@@ -721,7 +722,7 @@ define([
try {
var comment = Finder.findComment(0, ast);
if(!comment) {
- Assert.fail("Should have found a comment");
+ assert.fail("Should have found a comment");
}
}
finally {
@@ -740,7 +741,7 @@ define([
try {
var comment = Finder.findComment(4, ast);
if(!comment) {
- Assert.fail("Should have found a comment");
+ assert.fail("Should have found a comment");
}
}
finally {
@@ -759,7 +760,7 @@ define([
try {
var comment = Finder.findComment(11, ast);
if(!comment) {
- Assert.fail("Should have found a comment");
+ assert.fail("Should have found a comment");
}
}
finally {
@@ -778,7 +779,7 @@ define([
try {
var comment = Finder.findComment(14, ast);
if(!comment) {
- Assert.fail("Should have found a comment");
+ assert.fail("Should have found a comment");
}
}
finally {
@@ -797,7 +798,7 @@ define([
try {
var comment = Finder.findComment(19, ast);
if(!comment) {
- Assert.fail("Should have found a comment");
+ assert.fail("Should have found a comment");
}
}
finally {
@@ -816,7 +817,7 @@ define([
try {
var comment = Finder.findComment(26, ast);
if(!comment) {
- Assert.fail("Should have found a comment");
+ assert.fail("Should have found a comment");
}
}
finally {
@@ -834,7 +835,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(-1, ast);
- Assert.equal(token, null, "Should not have found a token for a negative offset");
+ assert.equal(token, null, "Should not have found a token for a negative offset");
}
finally {
astManager.updated();
@@ -851,7 +852,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(null, ast);
- Assert.equal(token, null, "Should not have found a token for a null offset");
+ assert.equal(token, null, "Should not have found a token for a null offset");
}
finally {
astManager.updated();
@@ -868,7 +869,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findToken(undefined, ast);
- Assert.equal(token, null, "Should not have found a token for an undefined offset");
+ assert.equal(token, null, "Should not have found a token for an undefined offset");
}
finally {
astManager.updated();
@@ -885,7 +886,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findNode(null, ast);
- Assert.equal(token, null, "Should not have found a node for a null offset");
+ assert.equal(token, null, "Should not have found a node for a null offset");
}
finally {
astManager.updated();
@@ -902,7 +903,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findNode(-1, ast);
- Assert.equal(token, null, "Should not have found a node for a negative offset");
+ assert.equal(token, null, "Should not have found a node for a negative offset");
}
finally {
astManager.updated();
@@ -919,7 +920,7 @@ define([
return astManager.getAST(setUp(text)).then(function(ast) {
try {
var token = Finder.findNode(undefined, ast);
- Assert.equal(token, null, "Should not have found a node for an undefined offset");
+ assert.equal(token, null, "Should not have found a node for an undefined offset");
}
finally {
astManager.updated();
diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/indexFileParsingTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/indexFileParsingTests.js
index c92ac00..f7858e2 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/indexFileParsingTests.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/indexFileParsingTests.js
@@ -15,8 +15,9 @@
define([
'javascript/contentAssist/typesFromIndexFile',
'javascript/contentAssist/typeEnvironment',
- 'orion/assert'
-], function(mTypes, typeEnv, assert) {
+ 'chai/chai'
+], function(mTypes, typeEnv, chai) {
+ var assert = chai.assert;
//////////////////////////////////////////////////////////
// helpers
diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js
index 63529f9..0f3e1a6 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js
@@ -10,11 +10,12 @@
******************************************************************************/
/*global console:true define*/
define([
- 'orion/assert',
+ 'chai/chai',
'javascript/astManager',
'orion/Deferred',
'javascript/occurrences'
-], function(Assert, ASTManager, Deferred, Occurrences) {
+], function(chai, ASTManager, Deferred, Occurrences) {
+ var assert = chai.assert;
var astManager = new ASTManager.ASTManager();
var occurrences = new Occurrences.JavaScriptOccurrences(astManager);
@@ -57,9 +58,9 @@ define([
*/
function assertOccurrences(results, expected) {
if(!results) {
- Assert.fail("The occurrence array cannot be null");
+ assert.fail("The occurrence array cannot be null");
}
- Assert.equal(results.length, expected.length, "The wrong number of occurrences was returned");
+ assert.equal(results.length, expected.length, "The wrong number of occurrences was returned");
for(var i = 0; i < expected.length; i++) {
//for each expected result try to find it in the results, and remove it if it is found
for(var j = 0; j < results.length; j++) {
@@ -73,7 +74,7 @@ define([
}
for(var k = 0; k < results.length; k++) {
if(results[k]) {
- Assert.fail("Found an unknown occurrence: [start "+results[k].start+"][end "+results[k].end+"]");
+ assert.fail("Found an unknown occurrence: [start "+results[k].start+"][end "+results[k].end+"]");
}
}
};
diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/outlinerTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/outlinerTests.js
index ad5d82b..a9789cf 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/outlinerTests.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/outlinerTests.js
@@ -10,11 +10,12 @@
******************************************************************************/
/*global console:true define*/
define([
- 'orion/assert',
+ 'chai/chai',
'javascript/astManager',
'orion/Deferred',
'javascript/outliner'
-], function(Assert, ASTManager, Deferred, Outliner) {
+], function(chai, ASTManager, Deferred, Outliner) {
+ var assert = chai.assert;
var astManager = new ASTManager.ASTManager();
var outliner = new Outliner.JSOutliner(astManager);
@@ -51,20 +52,20 @@ define([
*/
function assertElement(element, label, start, end) {
if(!element) {
- Assert.fail("The tested element cannot be null");
+ assert.fail("The tested element cannot be null");
}
if(!element.label) {
- Assert.fail("The outlined element must have a label");
+ assert.fail("The outlined element must have a label");
}
if(!element.start) {
- Assert.fail("The outlined element must have a start range");
+ assert.fail("The outlined element must have a start range");
}
if(!element.end) {
- Assert.fail("The outlied element must have an end range");
+ assert.fail("The outlied element must have an end range");
}
- Assert.equal(element.label, label, "The label is not the same");
- Assert.equal(element.start, start, "The start range is not the same");
- Assert.equal(element.end, end, "The end range is not the same");
+ assert.equal(element.label, label, "The label is not the same");
+ assert.equal(element.start, start, "The start range is not the same");
+ assert.equal(element.end, end, "The end range is not the same");
};
var Tests = {};
@@ -77,7 +78,7 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
assertElement(outline[0], "F1(p1, p2)", 9, 11);
}
@@ -97,10 +98,10 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one child outline element");
+ assert.fail("There should be one child outline element");
}
assertElement(outline[0].children[0], "item(p1, p2)", 13, 17);
}
@@ -118,7 +119,7 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
assertElement(outline[0], "var object = {...}", 4, 10);
}
@@ -139,10 +140,10 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one child outline element");
+ assert.fail("There should be one child outline element");
}
assertElement(outline[0].children[0], "item(p1, p2)", 13, 19);
}
@@ -163,10 +164,10 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one child outline element");
+ assert.fail("There should be one child outline element");
}
assertElement(outline[0].children[0], "item", 13, 19);
}
@@ -187,10 +188,10 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one child outline element");
+ assert.fail("There should be one child outline element");
}
assertElement(outline[0].children[0], "item {...}", 13, 19);
}
@@ -211,10 +212,10 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one child outline element");
+ assert.fail("There should be one child outline element");
}
assertElement(outline[0].children[0], "item(p1, p2)", 13, 19);
}
@@ -235,10 +236,10 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one child outline element");
+ assert.fail("There should be one child outline element");
}
assertElement(outline[0].children[0], "item", 13, 19);
}
@@ -259,10 +260,10 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one child outline element");
+ assert.fail("There should be one child outline element");
}
assertElement(outline[0].children[0], "item {...}", 13, 19);
}
@@ -283,10 +284,10 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one child outline element");
+ assert.fail("There should be one child outline element");
}
assertElement(outline[0].children[0], "return {...}", 18, 24);
}
@@ -307,10 +308,10 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one child outline element");
+ assert.fail("There should be one child outline element");
}
assertElement(outline[0].children[0], "return {...}", 18, 24);
}
@@ -333,16 +334,16 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one level one child outline element");
+ assert.fail("There should be one level one child outline element");
}
if(!outline[0].children[0].children || outline[0].children[0].children.length < 1) {
- Assert.fail("There should be one level two child outline element");
+ assert.fail("There should be one level two child outline element");
}
if(!outline[0].children[0].children[0].children || outline[0].children[0].children[0].children.length < 1) {
- Assert.fail("There should be one level three child outline element");
+ assert.fail("There should be one level three child outline element");
}
assertElement(outline[0].children[0].children[0].children[0], "return {...}", 45, 51);
}
@@ -365,16 +366,16 @@ define([
return outliner.computeOutline(context).then(function(outline) {
try {
if(!outline || outline.length < 1) {
- Assert.fail("There should be one outline element");
+ assert.fail("There should be one outline element");
}
if(!outline[0].children || outline[0].children.length < 1) {
- Assert.fail("There should be one level one child outline element");
+ assert.fail("There should be one level one child outline element");
}
if(!outline[0].children[0].children || outline[0].children[0].children.length < 1) {
- Assert.fail("There should be one level two child outline element");
+ assert.fail("There should be one level two child outline element");
}
if(!outline[0].children[0].children[0].children || outline[0].children[0].children[0].children.length < 1) {
- Assert.fail("There should be one level three child outline element");
+ assert.fail("There should be one level three child outline element");
}
assertElement(outline[0].children[0].children[0].children[0], "return {...}", 45, 51);
}
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/HTMLTemplates/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/HTMLTemplates/testcase.js
index 887e07b..2780d3f 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/HTMLTemplates/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/HTMLTemplates/testcase.js
@@ -11,7 +11,8 @@
/*global define document*/
-define(["orion/assert", "orion/HTMLTemplates-shim", "domReady!"], function(assert, URITemplate) {
+define(["chai/chai", "orion/HTMLTemplates-shim", "domReady!"], function(chai, URITemplate) {
+ var assert = chai.assert;
var tests = {};
tests.testTemplateElement = function() {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/URITemplate/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/URITemplate/testcase.js
index 4e80f83..542e7b0 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/URITemplate/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/URITemplate/testcase.js
@@ -11,7 +11,8 @@
/*global define */
-define(["orion/assert", "orion/URITemplate"], function(assert, URITemplate) {
+define(["chai/chai", "orion/URITemplate"], function(chai, URITemplate) {
+ var assert = chai.assert;
var tests = {};
var variables = {
@@ -29,6 +30,7 @@ define(["orion/assert", "orion/URITemplate"], function(assert, URITemplate) {
x: "1024",
y: "768",
empty: "",
+ empty_list: [],
empty_keys: {},
undef: null,
encodedpct: "%25%A2"
@@ -96,8 +98,12 @@ define(["orion/assert", "orion/URITemplate"], function(assert, URITemplate) {
assert.equal(new URITemplate("{,path:6}/here").expand(variables), "/foo/b/here");
assert.equal(new URITemplate("{,list}").expand(variables), "red,green,blue");
assert.equal(new URITemplate("{,list*}").expand(variables), "red,green,blue");
+ assert.equal(new URITemplate("{,empty_list}").expand(variables), "");
+ assert.equal(new URITemplate("{,empty_list*}").expand(variables), "");
assert.equal(new URITemplate("{,keys}").expand(variables), "semi,;,dot,.,comma,%2C");
assert.equal(new URITemplate("{,keys*}").expand(variables), "semi=;,dot=.,comma=%2C");
+ assert.equal(new URITemplate("{,empty_keys}").expand(variables), "");
+ assert.equal(new URITemplate("{,empty_keys*}").expand(variables), "");
assert.equal(new URITemplate("{,encodedpct}").expand(variables), "%25%A2");
};
return tests;
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/URL-old/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/URL-old/testcase.js
index e7a5668..ca268ed 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/URL-old/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/URL-old/testcase.js
@@ -11,7 +11,8 @@
/*global define document URL*/
-define(["orion/assert", "orion/URL-shim", "domReady!"], function(assert) {
+define(["chai/chai", "orion/URL-shim", "domReady!"], function(chai) {
+ var assert = chai.assert;
var tests = {};
tests.testSpecificationURL = function() {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/URL/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/URL/testcase.js
index b4181d0..9b14e8d 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/URL/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/URL/testcase.js
@@ -11,7 +11,8 @@
/*global define document URL*/
-define(["orion/assert", "orion/URL-shim", "domReady!"], function(assert) {
+define(["chai/chai", "orion/URL-shim", "domReady!"], function(chai) {
+ var assert = chai.assert;
var tests = {};
tests.testSpecificationURL = function() {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/asyncStyler/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/asyncStyler/testcase.js
index c226c9e..3cd4304 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/asyncStyler/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/asyncStyler/testcase.js
@@ -9,12 +9,13 @@
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
/*global define setTimeout window*/
-define(['orion/assert', 'orion/Deferred', 'orion/testHelpers', 'js-tests/editor/mockTextView', 'orion/editor/AsyncStyler',
+define(['chai/chai', 'orion/Deferred', 'orion/testHelpers', 'js-tests/editor/mockTextView', 'orion/editor/AsyncStyler',
'orion/serviceregistry', 'orion/EventTarget'],
- function(assert, Deferred, testHelpers, mMockTextView, AsyncStyler, mServiceRegistry, EventTarget) {
-var MockTextView = mMockTextView.MockTextView;
+ function(chai, Deferred, testHelpers, mMockTextView, AsyncStyler, mServiceRegistry, EventTarget) {
+ var assert = chai.assert;
+ var MockTextView = mMockTextView.MockTextView;
-var tests = {};
+ var tests = {};
tests['test AsyncStyler listens to highlight provider service'] = function() {
var serviceRegistry = new mServiceRegistry.ServiceRegistry();
var textView = new MockTextView();
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/base64/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/base64/testcase.js
index e6fc756..042da56 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/base64/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/base64/testcase.js
@@ -11,7 +11,8 @@
/*global define console Uint8Array*/
-define(["orion/assert", "orion/Base64", "domReady!"], function(assert, Base64) {
+define(["chai/chai", "orion/Base64", "domReady!"], function(chai, Base64) {
+ var assert = chai.assert;
var tests = {};
var testData = "abcdef";
testData += testData;
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/charDiff/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/charDiff/testcase.js
index 3e02312..a317551 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/charDiff/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/charDiff/testcase.js
@@ -10,9 +10,8 @@
******************************************************************************/
/*global define orion */
-define(["orion/assert", "orion/compare/jsdiffAdapter"], function(assert, mJSDiffAdapter) {
-
-
+define(["chai/chai", "orion/compare/jsdiffAdapter"], function(chai, mJSDiffAdapter) {
+ var assert = chai.assert;
var tests = {};
var adapter = new mJSDiffAdapter.JSDiffAdapter();
/**
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/commands/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/commands/testcase.js
index 5fcf578..5b352bc 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/commands/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/commands/testcase.js
@@ -10,8 +10,9 @@
******************************************************************************/
/*global define orion window document */
-define(['require', 'orion/assert', 'orion/serviceregistry', 'orion/commandRegistry', 'orion/commands', 'orion/keyBinding', 'orion/selection', 'orion/Deferred', 'orion/webui/littlelib', 'orion/webui/dropdown'],
- function(require, assert, mServiceregistry, mCommandRegistry, mCommands, mKeyBinding, mSelection, Deferred, lib, mDropdown) {
+define(['require', 'chai/chai', 'orion/serviceregistry', 'orion/commandRegistry', 'orion/commands', 'orion/keyBinding', 'orion/selection', 'orion/Deferred', 'orion/webui/littlelib', 'orion/webui/dropdown'],
+ function(require, chai, mServiceregistry, mCommandRegistry, mCommands, mKeyBinding, mSelection, Deferred, lib, mDropdown) {
+ var assert = chai.assert;
/**
* dom elements we need
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/commonjs-unittesting/test.html b/bundles/org.eclipse.orion.client.ui/web/js-tests/commonjs-unittesting/test.html
index 192a438..1854b2b 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/commonjs-unittesting/test.html
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/commonjs-unittesting/test.html
@@ -17,8 +17,8 @@
var exports = {};
var module = {};
- define("assert", ["orion/assert"], function(assert) {
- return assert;
+ define("assert", ["chai/chai"], function(chai) {
+ return chai.assert;
});
define("test", ["orion/test"], function(test) {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/compare/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/compare/testcase.js
index 6682741..c9ed8a7 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/compare/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/compare/testcase.js
@@ -11,7 +11,7 @@
/*global define JsDiff*/
/*jslint forin:true regexp:false sub:true*/
-define(['orion/assert',
+define(['chai/chai',
'orion/compare/diffParser',
'orion/compare/jsdiffAdapter',
'orion/compare/diffTreeNavigator',
@@ -19,7 +19,8 @@ define(['orion/assert',
'orion/editor/textModel',
'mapper-test-data.js',
'jsdiff/diff'],
-function(assert, mDiffParser, mJSDiffAdapter, mDiffTreeNavigator, mCompareUtils, mTextModel, mMapperTestData) {
+function(chai, mDiffParser, mJSDiffAdapter, mDiffTreeNavigator, mCompareUtils, mTextModel, mMapperTestData) {
+ var assert = chai.assert;
var tests = {};
var mapperTestCases = mMapperTestData.mapperTestCases;
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/config/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/config/testcase.js
index 211f5ca..6d6ddbb 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/config/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/config/testcase.js
@@ -9,8 +9,9 @@
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
/*global define setTimeout window*/
-define(['orion/assert', 'orion/Deferred', 'orion/testHelpers', 'orion/config', 'orion/serviceregistry', 'orion/pluginregistry'],
- function(assert, Deferred, testHelpers, config, mServiceRegistry, mPluginRegistry) {
+define(['chai/chai', 'orion/Deferred', 'orion/testHelpers', 'orion/config', 'orion/serviceregistry', 'orion/pluginregistry'],
+ function(chai, Deferred, testHelpers, config, mServiceRegistry, mPluginRegistry) {
+ var assert = chai.assert;
var ConfigAdminFactory = config.ConfigurationAdminFactory;
var MANAGED_SERVICE = 'orion.cm.managedservice';
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/contentTypes/contentTypesTests.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/contentTypes/contentTypesTests.js
index 4f28fa7..986c670 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/contentTypes/contentTypesTests.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/contentTypes/contentTypesTests.js
@@ -10,10 +10,11 @@
******************************************************************************/
/*global define window*/
define([
- 'orion/assert',
+ 'chai/chai',
'orion/contentTypes',
'orion/serviceregistry'
-], function(assert, mContentTypes, mServiceRegistry) {
+], function(chai, mContentTypes, mServiceRegistry) {
+ var assert = chai.assert;
var ServiceRegistry = mServiceRegistry.ServiceRegistry;
var ContentTypeRegistry = mContentTypes.ContentTypeRegistry;
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/dispatcher/editDispatcherTests.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/dispatcher/editDispatcherTests.js
index ece19f1..8d6d3e4 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/dispatcher/editDispatcherTests.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/dispatcher/editDispatcherTests.js
@@ -11,12 +11,13 @@
/*global define esprima:true*/
define([
'js-tests/editor/mockEditor',
- 'orion/assert',
+ 'chai/chai',
'orion/Deferred',
'orion/edit/dispatcher',
'orion/contentTypes',
'orion/serviceregistry'
-], function(MockEditor, assert, Deferred, mDispatcher, mContentTypes, mServiceRegistry) {
+], function(MockEditor, chai, Deferred, mDispatcher, mContentTypes, mServiceRegistry) {
+ var assert = chai.assert;
function setup() {
var serviceRegistry = new mServiceRegistry.ServiceRegistry(),
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/encoding/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/encoding/testcase.js
index 6b97e65..0fb6903 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/encoding/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/encoding/testcase.js
@@ -11,7 +11,8 @@
/*global define document TextEncoder TextDecoder Uint8Array unescape escape*/
-define(["orion/assert", "orion/encoding-shim", "domReady!"], function(assert) {
+define(["chai/chai", "orion/encoding-shim", "domReady!"], function(chai) {
+ var assert = chai.assert;
var tests = {};
var bigtest = "\uD83D\uDCA9Bâcòл ïpѕûm dòɭòr sìt àmèt ѕh߀uɭdèr ɭáƅorïѕ ρaríɑtür êt dòlor ρäԉcéttá ɦɑϻ ût. Màǥnã cònѕectetúr shoúldér c߀mϻòԁo miԉïϻ téԉdèrɭoín. Cònsèqüåt ádiρìsïcinǥ túrᏧückêл têԉdêrɭ߀iԉ fìɭèt miɢлon cɦícƙeл. Aütë âᏧ eХercitàtìòл Ꮷêѕerûԉt ߀ffïcíâ. Pòrƙ loin bålɭ tïp strìp ѕteàk, pïɢ sհoùlԁër c߀nѕectêtùr jêrky ѕïлt léƃêrƙás riƅeyë ѵòɭûptàtê ülɭàϻc߀.Bèëf ríƃs յèrƙy déѕërúnt ƙïéɭƃäsá. Lɑƃòrïs út ƃéef t-b߀ԉè strip steɑƙ êst. Drúϻѕtícƙ ƃiɭt߀ng հämƃurɢer, ԉòԉ cíɭlûϻ cülpɑ tùrƙéϒ ѕïԉt eíûѕϻ߀Ꮷ лûlɭá åлïm aԉԁ߀ûiɭle. Short riƃѕ òffïcià lãborê chìcƙén cow. Càpicòla éú duïѕ út fílet ϻigԉ߀л ѕûnt. Meɑtƅâll ƃrèѕáòla fláԉƙ cɦìcƙên c߀rԉèᏧ béef, fûɢìät tongüe stríρ steãk eх.AԉᏧòùiɭɭê làbòre ϻeátɭoãf éх flánƙ, fatbâck sirɭoïԉ brìѕƙét ɭêƅêrƙas. Eú ƅíɭtòлɢ sint ԉostrüԁ ѕհoûɭdêr âlíɋùìp, ԁo súԉt íлcìᏧïԁûnt jërƙϒ têϻp߀r ѕëd. Coԉséɋúãt shåлƙ desèruԉt frɑԉkfürter ρroídèлt ɭâborè culpå teлdêrɭ߀ìԉ. Alíɋùíp tùrkéϒ ëâ iԉ sɯìne pork loiԉ ρork ƃeɭly Ꮷoɭ߀ré ɦäm հ߀cƙ aúte. Proídèԉt còɯ ɭäƃorè éХ íd. Dòl߀r ԁ߀ ѕհ߀rt l߀iԉ, còԉѕëɋûåt mìлim páԉcëttâ tãil ѕüлt ԁòɭ߀re ϻàǥná voɭúptɑtê ρ߀rk ƅèlly ët fraлƙfurter túrkêy. Duiѕ pɑѕtramí ƅòúdiл bɑc߀n cãpícòlâ, ríbëϒê ԁ߀ ϻéàtbåɭɭ êХcèptèur ëst ԉòstrud ëѕѕe pârïɑtur.";
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/extensionParsing/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/extensionParsing/testcase.js
index ccdd9d9..bde90b4 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/extensionParsing/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/extensionParsing/testcase.js
@@ -10,9 +10,9 @@
******************************************************************************/
/*global define orion window document */
-define(['require', 'orion/assert', 'orion/serviceregistry', 'orion/commandRegistry', 'orion/extensionCommands'],
- function(require, assert, mServiceregistry, mCommandRegistry, mExtensionCommands) {
-
+define(['require', 'chai/chai', 'orion/serviceregistry', 'orion/commandRegistry', 'orion/extensionCommands'],
+ function(require, chai, mServiceregistry, mCommandRegistry, mExtensionCommands) {
+ var assert = chai.assert;
/**
* mock services
*/
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/fileapi/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/fileapi/testcase.js
index 0f1ed8c..9b7f6cc 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/fileapi/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/fileapi/testcase.js
@@ -8,7 +8,8 @@
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
/*global define XPathResult DOMParser*/
-define(["orion/assert", "orion/serviceregistry", "orion/pluginregistry"], function(assert, mServiceregistry, mPluginregistry) {
+define(["chai/chai", "orion/serviceregistry", "orion/pluginregistry"], function(chai, mServiceregistry, mPluginregistry) {
+ var assert = chai.assert;
var tests = {};
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/githubfileapi/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/githubfileapi/testcase.js
index aac5fcd..c8a122c 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/githubfileapi/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/githubfileapi/testcase.js
@@ -11,7 +11,8 @@
/*global define console Uint8Array*/
-define(["orion/assert", "plugins/filePlugin/GitHubFileImpl", "domReady!"], function(assert, GitHubFileImpl) {
+define(["chai/chai", "plugins/filePlugin/GitHubFileImpl", "domReady!"], function(chai, GitHubFileImpl) {
+ var assert = chai.assert;
var tests = {};
tests.testrepo = function() {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/globalSearch/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/globalSearch/testcase.js
index 8b8ed15..b86c302 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/globalSearch/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/globalSearch/testcase.js
@@ -10,7 +10,8 @@
******************************************************************************/
/*global define orion */
-define(["orion/assert", "orion/searchUtils"], function(assert, mSearchUtils) {
+define(["chai/chai", "orion/searchUtils"], function(chai, mSearchUtils) {
+ var assert = chai.assert;
/**
* Generate a dummy search model node on a file.
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/i18n/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/i18n/testcase.js
index e287fa0..bfb039c 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/i18n/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/i18n/testcase.js
@@ -11,7 +11,8 @@
/*global define console setTimeout navigator*/
-define(["require", "orion/Deferred", "orion/bootstrap", "orion/assert", "orion/i18nUtil", "orion/i18n"], function(require, Deferred, bootstrap, assert, i18nUtil) {
+define(["require", "orion/Deferred", "orion/bootstrap", "chai/chai", "orion/i18nUtil", "orion/i18n"], function(require, Deferred, bootstrap, chai, i18nUtil) {
+ var assert = chai.assert;
var I18N_PLUGIN = "orion/i18n";
var tests = {};
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/metatype/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/metatype/testcase.js
index 46c6f27..bdf7e9c 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/metatype/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/metatype/testcase.js
@@ -9,8 +9,9 @@
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
/*global define*/
-define(['orion/assert', 'orion/Deferred', 'orion/testHelpers', 'orion/serviceregistry', 'orion/metatype'],
- function(assert, Deferred, testHelpers, mServiceRegistry, mMetaType) {
+define(['chai/chai', 'orion/Deferred', 'orion/testHelpers', 'orion/serviceregistry', 'orion/metatype'],
+ function(chai, Deferred, testHelpers, mServiceRegistry, mMetaType) {
+ var assert = chai.assert;
var METATYPE_SERVICE = 'orion.cm.metatype';
var serviceRegistry, metaTypeRegistry;
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/objects/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/objects/testcase.js
index 78ed410..f650a4d 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/objects/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/objects/testcase.js
@@ -10,10 +10,10 @@
******************************************************************************/
/*global define */
define([
- "orion/assert",
+ "chai/chai",
"orion/objects"
-], function(assert, objects) {
-
+], function(chai, objects) {
+ var assert = chai.assert;
var tests = {};
tests.test_clone_object = function() {
var foo = {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/pageUtil/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/pageUtil/testcase.js
index d494541..cc84496 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/pageUtil/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/pageUtil/testcase.js
@@ -10,7 +10,8 @@
******************************************************************************/
/*global window define */
-define(["orion/assert", "orion/URITemplate", "orion/PageUtil"], function(assert, URITemplate, PageUtil) {
+define(["chai/chai", "orion/URITemplate", "orion/PageUtil"], function(chai, URITemplate, PageUtil) {
+ var assert = chai.assert;
var tests = {};
var aResource = "http://localhost/a/resource";
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/pluginRegistry/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/pluginRegistry/testcase.js
index 2593249..e397132 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/pluginRegistry/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/pluginRegistry/testcase.js
@@ -11,7 +11,8 @@
/*global define navigator Worker console*/
-define(["orion/assert", "orion/serviceregistry", "orion/pluginregistry", "orion/Deferred"], function(assert, mServiceregistry, mPluginregistry, Deferred) {
+define(["chai/chai", "orion/serviceregistry", "orion/pluginregistry", "orion/Deferred"], function(chai, mServiceregistry, mPluginregistry, Deferred) {
+ var assert = chai.assert;
var tests = {};
tests["test init/stop empty registry"] = function() {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/preferences/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/preferences/testcase.js
index 887d901..8c637e5 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/preferences/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/preferences/testcase.js
@@ -9,7 +9,8 @@
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
/*global define top orion console localStorage document window*/
-define(["orion/assert", "orion/Deferred"], function(assert, Deferred) {
+define(["chai/chai", "orion/Deferred"], function(chai, Deferred) {
+ var assert = chai.assert;
var tests = {};
function saveStorage(storage) {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/searchCrawler/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/searchCrawler/testcase.js
index 96f855b..aef0978 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/searchCrawler/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/searchCrawler/testcase.js
@@ -9,8 +9,8 @@
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
/*global define console window*/
-define(['orion/assert', 'mockFileClient.js', 'orion/crawler/searchCrawler', 'orion/contentTypes', 'orion/serviceregistry', 'orion/Deferred'], function(assert, mMockFileClient, mSearchCrawler, mContentTypes, mServiceRegistry, Deferred) {
-
+define(['chai/chai', 'mockFileClient.js', 'orion/crawler/searchCrawler', 'orion/contentTypes', 'orion/serviceregistry', 'orion/Deferred'], function(chai, mMockFileClient, mSearchCrawler, mContentTypes, mServiceRegistry, Deferred) {
+ var assert = chai.assert;
/****** mock up a file system tree ******/
var f1_1_Contents = "Search EveryWhere\n" + //js
"JavaScript is fun\n" +
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/searchRendering/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/searchRendering/testcase.js
index a846758..9331ade 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/searchRendering/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/searchRendering/testcase.js
@@ -9,8 +9,9 @@
* Andrew Eisenberg - initial API and implementation
******************************************************************************/
/*global define document*/
-define(["orion/assert", "orion/serviceregistry", "orion/searchRenderer"],
- function(assert, mServiceregistry, mSearchRenderer) {
+define(["chai/chai", "orion/serviceregistry", "orion/searchRenderer"],
+ function(chai, mServiceregistry, mSearchRenderer) {
+ var assert = chai.assert;
var tests = {};
tests.testEmptyRendererWithQueryName = function() {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/serviceRegistry/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/serviceRegistry/testcase.js
index 79ce4d1..faff348 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/serviceRegistry/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/serviceRegistry/testcase.js
@@ -11,7 +11,8 @@
/*global define console setTimeout*/
-define(["orion/assert", "orion/serviceregistry", "orion/EventTarget", "orion/Deferred"], function(assert, mServiceRegistry, EventTarget, Deferred) {
+define(["chai/chai", "orion/serviceregistry", "orion/EventTarget", "orion/Deferred"], function(chai, mServiceRegistry, EventTarget, Deferred) {
+ var assert = chai.assert;
var tests = {};
tests.testRegisterAndGetService = function() {
var count = 0;
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/serviceTracker/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/serviceTracker/testcase.js
index 70452f4..dd6c4fb 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/serviceTracker/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/serviceTracker/testcase.js
@@ -10,10 +10,11 @@
******************************************************************************/
/*global define */
define([
- "orion/assert",
+ "chai/chai",
"orion/serviceRegistry",
"orion/serviceTracker"
-], function(assert, mServiceRegistry, ServiceTracker) {
+], function(chai, mServiceRegistry, ServiceTracker) {
+ var assert = chai.assert;
var ServiceRegistry = mServiceRegistry.ServiceRegistry;
var tests = {};
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/settings/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/settings/testcase.js
index 650cfac..c012cbf 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/settings/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/settings/testcase.js
@@ -9,8 +9,9 @@
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
/*global define*/
-define(['orion/assert', 'orion/Deferred', 'orion/testHelpers', 'orion/serviceregistry', 'orion/metatype', 'orion/settings/settingsRegistry'],
- function(assert, Deferred, testHelpers, mServiceRegistry, mMetaType, SettingsRegistry) {
+define(['chai/chai', 'orion/Deferred', 'orion/testHelpers', 'orion/serviceregistry', 'orion/metatype', 'orion/settings/settingsRegistry'],
+ function(chai, Deferred, testHelpers, mServiceRegistry, mMetaType, SettingsRegistry) {
+ var assert = chai.assert;
var SETTING_SERVICE = 'orion.core.setting';
var METATYPE_SERVICE = 'orion.cm.metatype';
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/testOrionDeferred/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/testOrionDeferred/testcase.js
index dfb5f19..5bbcb9a 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/testOrionDeferred/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/testOrionDeferred/testcase.js
@@ -11,8 +11,8 @@
/*global define setTimeout console*/
-define(["orion/assert", "orion/test", "orion/Deferred"], function(assert, mTest, Deferred) {
-
+define(["chai/chai", "orion/test", "orion/Deferred"], function(chai, mTest, Deferred) {
+ var assert = chai.assert;
var tests = {};
// dummy change
tests["test basic synch"] = function() {};
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/testRunAsynch/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/testRunAsynch/testcase.js
index 23ed42e..906653b 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/testRunAsynch/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/testRunAsynch/testcase.js
@@ -11,181 +11,183 @@
/*global define setTimeout*/
-define(["orion/assert","orion/Deferred", "orion/test"], function(assert, Deferred, mTest) {
-
-var tests = {};
-// dummy change
-tests["test basic synch"] = function() {
-};
-
-tests["test subtest"] = {
- "test sub1" : function() {
- },
- "test sub2" : function() {
+define(["chai/chai", "orion/Deferred", "orion/test"], function(chai, Deferred, mTest) {
+ var assert = chai.assert;
+ var tests = {};
+ // dummy change
+ tests["test basic synch"] = function() {};
+
+ tests["test subtest"] = {
+ "test sub1": function() {},
+ "test sub2": function() {}
+ };
+
+ tests["test basic asynch"] = function() {
+ var d = new Deferred();
+ setTimeout(function() {
+ assert.ok(true);
+ d.resolve();
+ }, 100);
+ return d;
+ };
+
+ tests["test expected asynch failure"] = function() {
+
+ var failureTest = {
+ "test Failure": function() {
+ var d = new Deferred();
+ setTimeout(function() {
+ try {
+ assert.ok(false, "expected failure");
+ } catch (e) {
+ d.reject(e);
+ }
+ }, 100);
+ return d;
+ }
+ };
+ var newTest = new mTest.Test();
+ // by adding a dummy listener we avoid the error from useConsole() which is added if there are no listeners
+ var failures = 0;
+ newTest.addEventListener("testDone", function(event) {
+ if (event.result === false) {
+ failures++;
+ }
+ });
+ newTest.useLocal = true;
+
+ return newTest.run(failureTest).then(function() {
+ assert.equal(failures, 1);
+ });
+ };
+
+ tests["test basic asynch2"] = function() {
+ var d = new Deferred();
+ setTimeout(function() {
+ d.resolve();
+ }, 100);
+ return d.then(function() {
+ assert.ok(true);
+ });
+ };
+
+ tests["test expected asynch2 failure"] = function() {
+ var d = new Deferred();
+ setTimeout(function() {
+ d.resolve();
+ }, 100);
+ return d.then(function() {
+ throw "expected";
+ }).then(function() {
+ assert.ok(false); // unexpected, should be an error
+ }, function() {
+ assert.ok(true); // expected, catch the error and continue
+ });
+ };
+
+
+
+
+ tests["test basic list"] = function() {
+ var listTests = {
+ "test 1": function() {},
+ "test obj": {
+ "test2": function() {}
+ }
+ };
+ assert.deepEqual(mTest.list(listTests), ["test 1", "test obj.test2"]);
+ };
+
+ tests["test blow stack with promise"] = function() {
+ var first = new Deferred(),
+ d = first,
+ i, recurses = 0,
+ max = 1500;
+
+ function returnPromise() {
+ recurses++;
+ return first;
}
-};
-
-tests["test basic asynch"] = function() {
- var d = new Deferred();
- setTimeout(function(){
- assert.ok(true);
- d.resolve();
- }, 100);
- return d;
-};
-
-tests["test expected asynch failure"] = function() {
-
- var failureTest = {
- "test Failure": function() {
- var d = new Deferred();
- setTimeout(function(){
- try {
- assert.ok(false, "expected failure");
- } catch (e) {
- d.reject(e);
- }
- }, 100);
- return d;
+ for (i = 0; i < max; i++) {
+ d = d.then(returnPromise);
}
+ first.resolve();
+
+ return d.then(function() {
+ assert.ok(max === recurses, "Stack blown at " + recurses + " recurses.");
+ });
};
- var newTest = new mTest.Test();
- // by adding a dummy listener we avoid the error from useConsole() which is added if there are no listeners
- var failures = 0;
- newTest.addEventListener("testDone", function(event) {
- if (event.result === false) {
- failures++;
+
+ tests["test blow stack with value"] = function() {
+ var first = new Deferred(),
+ d = first,
+ i, recurses = 0,
+ max = 1500;
+
+ function returnValue() {
+ recurses++;
+ return 1;
}
- });
- newTest.useLocal = true;
-
- return newTest.run(failureTest).then(function() {
- assert.equal(failures, 1);
- });
-};
-
-tests["test basic asynch2"] = function() {
- var d = new Deferred();
- setTimeout(function(){
- d.resolve();
- }, 100);
- return d.then(function() {
- assert.ok(true);
- });
-};
-
-tests["test expected asynch2 failure"] = function() {
- var d = new Deferred();
- setTimeout(function(){
- d.resolve();
- }, 100);
- return d.then(function() {
- throw "expected";
- }).then (function() {
- assert.ok(false); // unexpected, should be an error
- }, function() {
- assert.ok(true); // expected, catch the error and continue
- });
-};
-
-
-
-
-tests["test basic list"] = function() {
- var listTests = {
- "test 1": function() {
- },
- "test obj": {
- "test2": function() {
- }
- }
- };
- assert.deepEqual(mTest.list(listTests), ["test 1", "test obj.test2"]);
-};
-
-tests["test blow stack with promise"] = function() {
- var first = new Deferred(),
- d = first, i, recurses = 0, max = 1500;
- function returnPromise() {
- recurses++;
- return first;
- }
- for (i = 0; i < max; i++) {
- d = d.then(returnPromise);
- }
- first.resolve();
-
- return d.then(function() {
- assert.ok(max === recurses, "Stack blown at " + recurses + " recurses.");
- });
-};
-
-tests["test blow stack with value"] = function() {
- var first = new Deferred(),
- d = first, i, recurses = 0, max = 1500;
-
- function returnValue() {
- recurses++;
- return 1;
- }
-
- for (i = 0; i < max; i++) {
- d = d.then(returnValue);
- }
- first.resolve();
-
- return d.then(function() {
- assert.ok(max === recurses, "Stack blown at " + recurses + " recurses.");
- });
-};
-
-tests["test blow stack with exception"] = function() {
- var first = new Deferred(),
- d = first, i, recurses = 0, max = 1500;
-
- function throwException() {
- recurses++;
- throw "exception";
- }
-
- for (i = 0; i < max; i++) {
- d = d.then(throwException, throwException);
- }
-
- first.resolve();
-
- return d.then(function(){
- assert.ok(false, "Expected an exception");
- }, function() {
- assert.ok(max === recurses, "Stack blown at " + recurses + " recurses.");
- });
-};
-
-tests["test timeout causes reject"] = function() {
- var timeout = 2000;
- var timeoutTest = {
- "test timeout": function() {
- return new Deferred();
+
+ for (i = 0; i < max; i++) {
+ d = d.then(returnValue);
}
+ first.resolve();
+
+ return d.then(function() {
+ assert.ok(max === recurses, "Stack blown at " + recurses + " recurses.");
+ });
};
- timeoutTest["test timeout"].timeout = timeout;
- var newTest = new mTest.Test();
- // by adding a dummy listener we avoid the error from useConsole() which is added if there are no listeners
- var d = new Deferred();
- var testDone = false;
- newTest.addEventListener("testDone", function(event) {
- assert.strictEqual(event.result, false, "Expected test failure");
- testDone = true;
- d.resolve();
- });
- newTest.useLocal = true;
- newTest.run(timeoutTest);
- setTimeout(function() {
- if (!testDone) {
- d.reject("Expected testDone to have called back by now");
+
+ tests["test blow stack with exception"] = function() {
+ var first = new Deferred(),
+ d = first,
+ i, recurses = 0,
+ max = 1500;
+
+ function throwException() {
+ recurses++;
+ throw "exception";
}
- }, timeout + 500 /* wait for our timeout to elapse before declaring failure */);
- return d;
-};
-return tests;
-});
+
+ for (i = 0; i < max; i++) {
+ d = d.then(throwException, throwException);
+ }
+
+ first.resolve();
+
+ return d.then(function() {
+ assert.ok(false, "Expected an exception");
+ }, function() {
+ assert.ok(max === recurses, "Stack blown at " + recurses + " recurses.");
+ });
+ };
+
+ tests["test timeout causes reject"] = function() {
+ var timeout = 2000;
+ var timeoutTest = {
+ "test timeout": function() {
+ return new Deferred();
+ }
+ };
+ timeoutTest["test timeout"].timeout = timeout;
+ var newTest = new mTest.Test();
+ // by adding a dummy listener we avoid the error from useConsole() which is added if there are no listeners
+ var d = new Deferred();
+ var testDone = false;
+ newTest.addEventListener("testDone", function(event) {
+ assert.strictEqual(event.result, false, "Expected test failure");
+ testDone = true;
+ d.resolve();
+ });
+ newTest.useLocal = true;
+ newTest.run(timeoutTest);
+ setTimeout(function() {
+ if (!testDone) {
+ d.reject("Expected testDone to have called back by now");
+ }
+ }, timeout + 500 /* wait for our timeout to elapse before declaring failure */ );
+ return d;
+ };
+ return tests;
+}); \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/typedefs/typedefsTestcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/typedefs/typedefsTestcase.js
index d0464b3..108fa7c 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/typedefs/typedefsTestcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/typedefs/typedefsTestcase.js
@@ -10,12 +10,13 @@
******************************************************************************/
/*global define*/
define([
- "orion/assert",
+ "chai/chai",
"orion/Deferred",
"orion/edit/typedefs",
"orion/edit/editorContext",
- "orion/serviceRegistry"
-], function(assert, Deferred, TypeDefRegistry, EditorContext, mServiceRegistry) {
+ "orion/serviceregistry"
+], function(chai, Deferred, TypeDefRegistry, EditorContext, mServiceRegistry) {
+ var assert = chai.assert;
var ServiceRegistry = mServiceRegistry.ServiceRegistry;
function setup() {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/urlUtils/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/urlUtils/testcase.js
index a1ae22c..c05ff27 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/urlUtils/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/urlUtils/testcase.js
@@ -10,7 +10,8 @@
******************************************************************************/
/*global define orion */
-define(["orion/assert", "orion/urlUtils"], function(assert, mUrlUtils) {
+define(["chai/chai", "orion/urlUtils"], function(chai, mUrlUtils) {
+ var assert = chai.assert;
// The test cases are for testing the urlUtils function to detect if a given text has any URL encoded by "[displayString](url)".
// Currently this detecting function is used as a parser for rendering a string in the shell page, by different segment. The segment is mixed by plain text and url link.
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/webdav/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/webdav/testcase.js
index e9a2991..33682be 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/webdav/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/webdav/testcase.js
@@ -10,7 +10,8 @@
******************************************************************************/
/*jslint browser: true, devel: true*/
/*global define XPathResult DOMParser*/
-define(["orion/assert", "orion/serviceregistry", "orion/pluginregistry", "webdav"], function(assert, mServiceregistry, mPluginregistry, mWebdav) {
+define(["chai/chai", "orion/serviceregistry", "orion/pluginregistry", "webdav"], function(chai, mServiceregistry, mPluginregistry, mWebdav) {
+ var assert = chai.assert;
var tests = {};
tests["test plugin GET call"] = function() {
diff --git a/bundles/org.eclipse.orion.client.ui/web/js-tests/xhr/testcase.js b/bundles/org.eclipse.orion.client.ui/web/js-tests/xhr/testcase.js
index 88edb15..3bc7208 100644
--- a/bundles/org.eclipse.orion.client.ui/web/js-tests/xhr/testcase.js
+++ b/bundles/org.eclipse.orion.client.ui/web/js-tests/xhr/testcase.js
@@ -10,9 +10,8 @@
******************************************************************************/
/*global console define navigator setTimeout Blob XMLHttpRequest*/
-define(["orion/assert", "orion/test", "orion/Deferred", "orion/xhr", "orion/editor/eventTarget"],
-
-function(assert, mTest, Deferred, xhr, mEventTarget) {
+define(["chai/chai", "orion/test", "orion/Deferred", "orion/xhr", "orion/editor/eventTarget"], function(chai, mTest, Deferred, xhr, mEventTarget) {
+ var assert = chai.assert;
var EventTarget = mEventTarget.EventTarget;
var isIE = navigator.appName.indexOf("Microsoft Internet Explorer") !== -1;
var hasReadyStateOpenedBug = (function() {