beautify_js
This commit is contained in:
parent
0febe4f5fd
commit
5c2f32e184
208 changed files with 3891 additions and 1474 deletions
|
@ -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);
|
||||
};
|
||||
};
|
|
@ -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()));
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue