beautify_js

This commit is contained in:
Ilya Kantor 2015-03-09 18:48:58 +03:00
parent 0febe4f5fd
commit 5c2f32e184
208 changed files with 3891 additions and 1474 deletions

View file

@ -1,4 +1,4 @@
function Article() {
function Article() {
this.created = new Date;
Article.count++; // увеличиваем счетчик при каждом вызове
@ -8,4 +8,4 @@ Article.count = 0; // начальное значение
Article.showStats = function() {
alert('Всего: ' + this.count + ', Последняя: ' + this.last);
};
};

View file

@ -3,7 +3,7 @@ describe("Article.showStats", function() {
sinon.stub(window, "alert");
this.clock = sinon.useFakeTimers();
});
after(function() {
window.alert.restore();
this.clock.restore();
@ -13,9 +13,9 @@ describe("Article.showStats", function() {
new Article();
this.clock.tick(100);
new Article();
Article.showStats();
assert( alert.calledWith('Всего: 2, Последняя: ' + new Date() ) );
Article.showStats();
assert(alert.calledWith('Всего: 2, Последняя: ' + new Date()));
});
it("и ещё одна статья...", function() {
@ -23,6 +23,6 @@ describe("Article.showStats", function() {
new Article();
Article.showStats();
assert( alert.calledWith('Всего: 3, Последняя: ' + new Date() ) );
assert(alert.calledWith('Всего: 3, Последняя: ' + new Date()));
});
});