Last active
December 10, 2015 17:05
-
-
Save Nepoxx/2d37d3d405173f0f7736 to your computer and use it in GitHub Desktop.
Revisions
-
Nepoxx revised this gist
Dec 10, 2015 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ describe("when navigating to a route", function() { jasmine.Ajax.uninstall(); }) it("should have called the err function, making 'errored' to be 'false'", function(done) { var errored = null; function err() { @@ -19,15 +19,19 @@ describe("when navigating to a route", function() { errored = false; } Thing.load().then(success).catch(err) .then(function () { expect(errored).toBe(false); done(); }); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, responseText: JSON.stringify({ }) }); }); }); -
Danny Hadley revised this gist
Dec 10, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ describe("when navigating to a route", function() { errored = false; } Thing.load().then(success).catch(err); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, -
Danny Hadley revised this gist
Dec 10, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ describe("when navigating to a route", function() { jasmine.Ajax.uninstall(); }) it("should have called the err function, making 'errored' to be 'false'", function() { var errored = null; function err() { -
Danny Hadley revised this gist
Dec 10, 2015 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,6 @@ describe("when navigating to a route", function() { }) }); expect(errored).toBe(false); }); -
Danny Hadley created this gist
Dec 10, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ var Thing = { load: function() { var resolve, reject; function finished() { resolve({}) } function errored() { reject({}); } function resolver(res, rej) { resolve = res; reject = rej; $.getJSON("/thing", {success: finished, error: errored}); } return new Promise(resolver); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ describe("when navigating to a route", function() { beforeEach(function() { jasmine.Ajax.install(); }); afterEach(function() { jasmine.Ajax.uninstall(); }) it("...", function() { var errored = null; function err() { errored = true; } function success() { errored = false; } Thing.load().finally(finished); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, responseText: JSON.stringify({ }) }); expect(errored).toBe(false); }); });