From abb5838113c9aaa4de35401164e39397713511fb Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Fri, 19 Dec 2014 11:51:34 -0500 Subject: [PATCH] Updating how async specs are called --- spec/parser/javascript/node_spec.js | 21 ++++++++++++++------- spec/parser/javascript_spec.js | 9 ++++++--- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/spec/parser/javascript/node_spec.js b/spec/parser/javascript/node_spec.js index 10a0668..a53d809 100644 --- a/spec/parser/javascript/node_spec.js +++ b/spec/parser/javascript/node_spec.js @@ -147,7 +147,8 @@ describe('parser/javascript/node.js', function() { expect(resolve).toHaveBeenCalledWith('result'); expect(reject).not.toHaveBeenCalled(); }) - .then(done); + .finally(done) + .done(); }); it('rejects the returned promise when the render is canceled', function(done) { @@ -161,7 +162,8 @@ describe('parser/javascript/node.js', function() { expect(resolve).not.toHaveBeenCalled(); expect(reject).toHaveBeenCalledWith('Render cancelled'); }) - .then(done); + .finally(done) + .done(); }); }); @@ -212,7 +214,8 @@ describe('parser/javascript/node.js', function() { expect(this.text.transform).toHaveBeenCalledWith(Snap.matrix() .translate(5, 22)); }) - .then(done); + .finally(done) + .done(); }); it('sets the dimensions of the rect element', function(done) { @@ -223,7 +226,8 @@ describe('parser/javascript/node.js', function() { height: 34 }); }) - .then(done); + .finally(done) + .done(); }); it('resolves with the group element', function(done) { @@ -231,7 +235,8 @@ describe('parser/javascript/node.js', function() { .then(group => { expect(group).toEqual(this.group); }) - .then(done); + .finally(done) + .done(); }); }); @@ -347,7 +352,8 @@ describe('parser/javascript/node.js', function() { .then(() => { expect(this.node.doneRender).toHaveBeenCalled(); }) - .then(done); + .finally(done) + .done(); }); it('ultimately resolves with the node instance', function(done) { @@ -355,7 +361,8 @@ describe('parser/javascript/node.js', function() { .then(result => { expect(result).toEqual(this.node); }) - .then(done); + .finally(done) + .done(); }); }); diff --git a/spec/parser/javascript_spec.js b/spec/parser/javascript_spec.js index 1676b50..6b59909 100644 --- a/spec/parser/javascript_spec.js +++ b/spec/parser/javascript_spec.js @@ -20,7 +20,8 @@ describe('parser/javascript.js', function() { .then(() => { expect(regexpParser.parse).toHaveBeenCalledWith('example expression'); }) - .finally(done); + .finally(done) + .done(); }); it('replaces newlines with "\\n"', function(done) { @@ -28,7 +29,8 @@ describe('parser/javascript.js', function() { .then(() => { expect(regexpParser.parse).toHaveBeenCalledWith('multiline\\nexpression'); }) - .finally(done); + .finally(done) + .done(); }); it('resolves the returned promise with the parser instance', function(done) { @@ -36,7 +38,8 @@ describe('parser/javascript.js', function() { .then(result => { expect(result).toEqual(this.parser); }) - .finally(done); + .finally(done) + .done(); }); });