Skip to content

Commit 92df92d

Browse files
committed
Fix assertion testing.
1 parent 0769648 commit 92df92d

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ BETA ======= 1.9.1 (HOTFIX)
2525
- fixed: F.exists() - problem with URL query string
2626
- fixed: framework startup path
2727
- fixed: Date.format()
28+
- fixed: Assertion Testing
2829

2930
======= 1.9.0
3031

index.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6109,8 +6109,15 @@ Framework.prototype.testing = function(stop, callback) {
61096109
}
61106110

61116111
var file = self.testsFiles.shift();
6112-
file.fn.call(self, self);
6113-
self.testing(stop, callback);
6112+
try {
6113+
file.fn.call(self, self);
6114+
self.testing(stop, callback);
6115+
} catch (e) {
6116+
console.log(new Error(e.stack, file.name, e.lineNumber));
6117+
framework.isTestError = true;
6118+
framework.testsNO++;
6119+
self.testing(stop, callback);
6120+
}
61146121
return self;
61156122
}
61166123

@@ -6258,7 +6265,7 @@ Framework.prototype.test = function(stop, names, cb) {
62586265

62596266
var dir = self.config['directory-tests'];
62606267

6261-
if (!fs.existsSync(utils.combine(dir))) {
6268+
if (!fs.existsSync(framework_utils.combine(dir))) {
62626269
if (cb) cb();
62636270
if (stop) setTimeout(function() {
62646271
framework.stop(0);
@@ -6307,10 +6314,9 @@ Framework.prototype.test = function(stop, names, cb) {
63076314
if (!framework.testsNO)
63086315
framework.testsNO = 0;
63096316

6310-
utils.ls(utils.combine(dir), function(files) {
6311-
6317+
framework_utils.ls(framework_utils.combine(dir), function(files) {
63126318
files.forEach(function(filePath) {
6313-
var name = path.relative(utils.combine(dir), filePath);
6319+
var name = path.relative(framework_utils.combine(dir), filePath);
63146320
var filename = filePath;
63156321
var ext = path.extname(filename).toLowerCase();
63166322

@@ -6353,7 +6359,7 @@ Framework.prototype.test = function(stop, names, cb) {
63536359
if (fn === null)
63546360
return;
63556361

6356-
self.testsFiles.push({ index: self.testsFiles.length, fn: fn, priority: framework.testsPriority });
6362+
self.testsFiles.push({ name: name, index: self.testsFiles.length, fn: fn, priority: framework.testsPriority });
63576363

63586364
if (test.usage) {
63596365
(function(test) {

0 commit comments

Comments
 (0)