Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

semicolons #63

Merged
merged 2 commits into from
Jan 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports.coreSetup = function(suite, auto) {

suite.test("base context", function() {
var base = dust.makeBase({
sayHello: function() { return "Hello!" }
sayHello: function() { return "Hello!"; }
});
testRender(this, "{sayHello} {foo}", base.push({foo: "bar"}), "Hello! bar");
});
Expand Down Expand Up @@ -78,7 +78,7 @@ exports.coreSetup = function(suite, auto) {
end: function () {
unit.pass();
}
})
});
});

suite.test("tap (plain text string literal)", function() {
Expand Down Expand Up @@ -260,7 +260,7 @@ exports.coreSetup = function(suite, auto) {
unit.pass();
});
});
}
};

function testRender(unit, source, context, expected, error) {
var name = unit.id;
Expand Down
12 changes: 6 additions & 6 deletions test/jasmine-test/spec/renderTestSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ function stream(test) {
flag= true;
}
});

waitsFor(function(){
return flag;
}, "the output", 500);

runs(function(){
if (test.error) {
expect(output).toEqual(test.error || {} );
} else {
expect(output).toEqual(test.expected);
}
});
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the trailing whitespace on lines 50, 54, 90, and 94 while your in this file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, add a semicolon to line 102

};

function pipe(test) {
Expand Down Expand Up @@ -87,17 +87,17 @@ function pipe(test) {
flag= true;
}
});

waitsFor(function(){
return flag;
}, "the output", 500);

runs(function(){
if (test.error) {
expect(output).toEqual(test.error || {});
} else {
expect(output).toEqual(test.expected);
}
});
}
};
};
18 changes: 9 additions & 9 deletions test/uutest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ Test.prototype.run = function() {
} catch(err) {
self.fail(err);
}
}
};

Test.prototype.equals = function(actual, expected, message) {
if (actual !== expected) {
var err = new Error();
if (message) err.message = message;
throw wrapAssertionError(err, actual, expected, "===");
}
}
};

Test.prototype.ifError = function(err) {
if (err) throw err;
}
};

Test.prototype.pass = function() {
clearTimeout(this.timer);
this.callback();
}
};

Test.prototype.fail = function(err) {
clearTimeout(this.timer);
this.callback(err);
}
};

uutest.Test = Test;

Expand All @@ -62,7 +62,7 @@ Suite.prototype.test = function(name, fn) {
self.pending--;
self.check();
}));
}
};

Suite.prototype.run = function() {
if (this.pending) return;
Expand All @@ -74,22 +74,22 @@ Suite.prototype.run = function() {
for (var i=0; i<len; i++) {
self.tests[i].run();
}
}
};

Suite.prototype.check = function() {
if (this.pending) return;
var len = this.tests.length,
passed = len - this.errors.length,
failed = len - passed;
this.emit("done", passed, failed, new Date().getTime() - this.start);
}
};

Suite.prototype.emit = function(type) {
var event = this.options[type];
if (event) {
event.apply(this, Array.prototype.slice.call(arguments, 1));
}
}
};

uutest.Suite = Suite;

Expand Down