By Developers, For Developers
| PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
|---|---|---|---|---|---|
| 2 | TYPO | “canary in a cole mine” —> “canary in a coal mine”. They were used to measure toxic levels of gases for coal miners. | 2016-04-22 | ||
| 31 | TYPO | The below test is expecting the result to be true. Spec description to be corrected in the following snippet. it(‘should return false for argument mom mom’, function() { expect(isPalindrome(‘mom mom’)).to.be.true; }); | 2016-04-24 | ||
| 21 | TYPO | In the page 20, the fahrenheit is written correct. In the page 21, h is missing from word farenheit. | 2016-04-30 | ||
| 61 | ERROR | The test file media.pragprog.com/titles/vsjavas/code/async/promises/test/files-test.js failed when I try “npm test”. The packages that are installed are from this file media.pragprog.com/titles/vsjavas/code/async/promises/package.json The error is: Error: Cannot find any-promise implementation nor global.Promise. You must install polyfill or call require(“any-promise/register”) with your preferred implementation, e.g. require(“any-promise/register”)(“bluebird”) on application load prior to any require(“any-promise”). | 2016-05-01 | Hi Astefanoaie, \n \nThank you for reporting this. I am not getting this error on Mac OS X and also on Windows 10. \n \nDid you do a npm install? Could you try to blow away the node_modules directory under promises and then try npm install. Then try npm test. If the problem still exists, could you please share with me your environment/system details. You may post the response back here or email me at venkats@agiledeveloper.com. \n \nThank you \n \nVenkat \n \n---- \nupdate: Thanks Astefanoaie for your update by email. | |
| 200 | SUGGEST | Angular Testing (Chapter 8) | 2016-05-06 | Hi Chip, \n \nThank you for the suggestion. The chapter 8 will stay with Angular 1.x, but I'm adding a new chapter exclusively for Angular 2.0. That way developers can use either one or both depending on their projects. \n \nThanks \n \nVenkat | |
| 104 | SUGGEST | The tests that exists in this moment(page 104) are passing for the code: Should the test “read should return error if given file is empty” ensure that the processTickers is not called because is in the “else” part? | 2016-05-09 | Hi Astefanoaie, \n \nIf there's no harm if that function is called (due to missing else), then that test would not provide much value. If calling the function with an empty tickers would cause harm, then it's better to redesign (with tests) to make such call safe rather than preventing it. In short, it's better not to make asynchronous test much harder than it should be. \n \nThanks \n \nVenkat | |
| 0 | 0 | ERROR | Sorry - don’t know page number because am reading the epub ebook :) The canary test for the chapter 5 stock fetch application fails as written. Basically, the beforeEach method attempts to create a new stockfetch object. But the object description hasn’t been created in stockfetch.js yet. I got around this by adding a stub implementation of stockfetch. But this seems to defeat the purpose of a canary test. Here is my stub implementation in case anyone wants it: var Stockfetch = function() {} | 2016-05-19 | |
| 19 | SUGGEST | A mention under “Your Own Workspace” that you cannot cut-and-paste code from the book would be helpful. Doing so will change encoding and characters such that any code from the book fails. | 2016-05-19 | ||
| 1 | 2 | SUGGEST | Sorry - using ebook so don’t know PDF page numbers! Many of the database functions in the testexpress chapter (chapter 6) use depreciated mongodb functions. While it’s easy to find the right functions (especially in intellj), it would be nice if the book used the non-depreciated functions! Here are some examples: .insert (use insertMany in before, insertOne in add) | 2016-05-20 | |
| 177,8 | ERROR | The test “callService should send xhr status code to callback” fails as written. This is because the onreadystatechange function is called multiple times with different states. To fix it, I had to change the onreadystatechange function to check the readyState field: xhr.onreadystatechange = function() { | 2016-05-19 | ||
| 180 | ERROR | The test “initpage should call getTasks” passes with no code written. This is because there is no expectation set on the mock object. Here is my version of the test that will fail: it(“initpage should call getTasks”, function() { initpage(); getTasksMock.verify(); Just a note: this is a really really great book! Thought I’d just put every issue I find here. | 2016-05-19 | ||
| 171 | ERROR | The expectations in the “getTasks should call callService” do not fail when the test fails. Same as the “addTask should call callService” test later on (this one I noticed because my date parsing was broken - I only noticed during a manual test at the end of the task add bit!) I had to rewrite it with a spy object as shown to get the test to fail properly: it(“getTasks should call callService”, function() { getTasks(); var params = callServiceSpy.getCalls()[0].args[0]; expect(params.method).to.be.eql(“GET”); }); | 2016-05-19 | ||
| 3, 19 | TYPO | util_test.js is written as util-test.js. Am new to serverside JS and have seen filenames as p1-p2.js a lot. Is there a standard? | 2016-05-19 | Hi, \n \nPlease post questions and discussions in the forum and any corrections in the errata. \n \nThank you. \n \nVenkat | |
| 3, 19 | TYPO | util_test.js is written as util-test.js. | 2016-05-20 | We will use - instead of _. Please see the related forum posting. Thanks. | |
| 163 | ERROR | Hi! | 2016-05-24 | Hi Astefanoaie, \n \nDid you run npm install in that directory before running npm start? \n \nI tried those two steps and did not get any error running npm start after npm install. \nPlease let me know if those two steps fix the issue for you. \n \nThanks, \n \nVenkat \n \nFollow up notes: Thanks to Astefanoaie for clarifying and explaining what I was missing. Adding the bin directory to the version control so it shows up properly. — Venakt | |
| 34 | TYPO | var fahrenheit = 32; | 2016-05-30 | ||
| 48 | TYPO | or simple blow up? | 2016-05-31 | ||
| 68 | TYPO | Contains extra }); It is: it(‘should report error for an invalid file name’, function(done) { var onError = function(error) { But should be: it(‘should report error for an invalid file name’, function(done) { | 2016-05-31 | ||
| 19 | SUGGEST | in the code, there is a variable for fahrenheit, but it is not used. a consolidated version might also be: (i wasn’t sure how consolidated you wanted to make the code) | 2016-06-01 | ||
| 91 | 76 | TYPO |
I believe it should read: | 2016-06-16 | |
| 23 | TYPO | Let’s turn out attention from writing tests to driving the design using tests. should be Let’s turn our attention from writing tests to driving the design using tests. | 2016-06-24 | ||
| 43 | TYPO | Karma and the browser will collaborate to take care of bring that on board. should be Karma and the browser will collaborate to take care of bringing that on board. | 2016-06-24 | ||
| 66 | TYPO | your mission, should you choose to accept should be your mission, should you choose to accept it | 2016-06-24 | ||
| 68 | SUGGEST | We’ll use the example on hand to learn and apply these design techniques suggest We’ll use the example at hand to learn and apply these design techniques | 2016-06-24 | ||
| 68 | SUGGEST | The dotted boxes are the external dependencies and the solid boxes are the code we’d write for the problem on hand. suggest The dotted boxes are the external dependencies and the solid boxes are the code we’d write for the problem at hand. | 2016-06-24 | ||
| 68 | SUGGEST | Dependency diagram shows setLocation has dependency on window. I don’t see the window dependency in the code of the spike. I see location. Perhaps this is some variable made available by karma or externally. Suggest adding window.location expression to the spike code to explicitly show the dependency or stating why the dependency exists when there is no window in the spike code. | 2016-06-24 | ||
| 68 | SUGGEST | In the design diagram, you define what the difference between the solid and dotted boxes are. Suggest you also define what the solid and dotted lines mean. | 2016-06-24 | ||
| 96 | SUGGEST | Same suggestion for the design diagram on page 96. There are no dotted boxes but are dotted lines. Not sure what exactly they signify. Suggest a few words to define them. | 2016-06-24 | ||
| 1 | SUGGEST | By the way, I am on page 113 of the book. Great book so far. Thanks. Hope you don’t mind if I send in feedback as I read it. | 2016-06-24 | Thank you very much Bruce. Sincerely appreciate the feedback and comments.—Venkat | |
| 99 | TYPO | The test’s in place, should be The test is in place, | 2016-06-24 | ||
| 106 | TYPO | stockfetchMock.expects(‘getPrice’).withArgs(‘A’) stockfetchMock.expects(‘getPrice’).withArgs(‘B’) stockfetchMock.expects(‘getPrice’).withArgs(‘C’); are semicolons not needed after the first two lines. The code runs fine but seems like ; are needed. | 2016-06-24 | ||
| 47 | TYPO | Now that this chapter has give us the foundation, | 2016-08-11 | ||
| 77 | TYPO | Furthermore, the response depends on where in the world we are while running the code and the accuracy of the service that response with the current location. | 2016-08-12 | ||
| 79 | SUGGEST | The key to writing automated test for locate was replacing the dependency with a test double. could be The key to writing automated tests for locate was replacing the dependency with a test double. | 2016-08-12 | ||
| 84 | SUGGEST | The failure could be due to one of several reasons including the user did not grant permission and is unable to access the network. could be The failure could be due to one of several reasons including the user did not grant permission or is unable to access the net- work. | 2016-08-12 | ||
| 101 | SUGGEST | Test on page 101 includes | 2016-08-17 | Bruce, thank you for the suggestion. The test needs the stub even though the minimum code we wrote to make the test to pass does not need it. As the code evolves, this test will eventually end up calling the real function (if not stubbed out) and we want to avoid that. \n \nThanks \n \nVenkat | |
| 116 | SUGGEST | Awesome book by the way. I am on 2nd time through, this time running all the code. page 116 says: | 2016-08-30 | ||
| 118 | TYPO | Print and sort are two separate concerns—a good design keeps concerns that are separate apart. should be Print and sort are two separate concerns—a good design keeps concerns that are separated apart. | 2016-09-14 | ||
| 115 | ERROR | The test named ‘getPriceForTickers should respond well for a valid file’ fails with the following error output from running the ‘npm test’ command 26 passing (10s) 1) Stockfetch tests getPriceForTickers should respond well for a valid file: I thought the reason was a typo of myself, but then I decided to try the official, original code of the book’s author and it’s failing too. I’m running npm version 2.15.9 and node version 4.6.0 on Ubuntu 16.04 TLS with GNU/Linux kernel version 4.8.0-26 on a CPU with x86_64 architecture | |||
| 215 | ERROR | Hi! Am I missing something or is there a harmless syntactic error in the ‘addTask should call the service’ test? The file at testangularjs/todo/test/client/tasks-controller-test.js for that test has this line: // … And the file at testangularjs/todo/public/javascripts/src/controllers/tasks-controller.js has the following implementation for the convertNewTaskToJSON controller’s function: // … return { As we can see, the controller’s convertNewTaskToJSON function doesn’t receive parameters and internally it works with the controller.newTask model. By something that I suppose is the nature of JavaScript, there is no error by passing an unexpected parameter to the function, but it confused me a little when I was studied the book’s example. Some of the changes that I did to that ‘addTask should call the service’ test are the following, which doesn’t break it: var convertedTask = controller.convertNewTaskToJSON(); // test continues passing I would like to know your comments about this and, if pertinent, see the corresponding updates to your entertaining book. Thanks! | |||
| 216 | ERROR | Hi again! By the same lines of a previous erratum I submitted some moments ago, the addTask function of the controller sends a newTask parameter that the convertNewTaskToJSON doesn’t expect. Originally we have this code: // .. Which can be modified to this, without negatively affecting the test results: // .. Or could be modified like this: // .. Again, am I missing something? Thank you! | |||
| 242 | ERROR | Hello! When exploring the angular spike of chapter 9 and running the “npm install” and “npm start” commands, I faced some errors like these: - HTTP 404 error responses about several non existing JavaScript files included from the index.html file. The reason is that the package.json that I started with did not have the full dependencies needed by the sample - Problems with the src/main.js file, specifically the line ng.platformBrowserDynamic.bootstrap(app.LangsComponent) because such “bootstrap” functions seems to no longer exist in versions of Angular more recent that the one used in the book samples - Dependencies conflict between different npm components. An illustrative output of one of my attempts is the following:
npm ERR! peerinvalid The package npm ERR! Please include the following file with any support request:
From a general investigation I did, the root cause is changes in the Angular internals. Given that I only wanted to run the sample, I modified the package.json file so that it uses specific versions of each dependency, instead of allowing open version ranges. The working dependencies section, inside package.json that I ended with, is this: “dependencies”: { It would be interesting to know how to make this sample spike working with the more recent versions of Angular 2 components. Hope this helps! | |||
| xvii | TYPO | page says unzip tdjsa.zip Pragmatic Site book page only offers vsjavas-code.zip | |||
| 278 | ERROR | Hello again! After running the “npm start” command and opening http :// localhost : 3000 page in a browser, the application fails because it doesn’t know about the validateTask() function. I solved it by updating the “head” section of the index.html file so that it has this line: I think a brief note about this need would come handy at this part of the book. Thank you! | |||
| 309 | TYPO | After listing the source for the AngularJS tests file, there is a typo in the file name mentioned. It says: “The first change is that instead of requiring tasksj.page.js, this test file brought in It can be corrected like this: “The first change is that instead of requiring tasksj.page.js, this test file brought in Hope this helps. Thanks for your time and attention! | |||
| 357 | SUGGEST | Today I’ve just finished my first exploration of this whole book by doing the examples in my own environment, typing them, studying each step and I can say it’s an excellent book. I like how the author explain things, making the complex seem simple and now I would like him to publish new books about the following: a) Following the Behavior Driven Development approach when developing JavaScript applications with frameworks like Ember.js or Angular and with tools similar to Cucumber and using the Given-When-Then syntax b) Using JavaScript on the client side (web browsers) with another programming language on the server side, like Python, Ruby, Elixir, Groovy or another one. Things like, for example, reusing the “validateTask” function on both the server and client side would no longer be possible, among other things Thanks a lot for authoring this book, I enjoyed it a lot! | |||
| 173 | TYPO | The code block in testdomjquery/todo/test/client/tasks-test.js will not fail. The xhr should give a response before expect is called, like this … | |||
| 173 | TYPO | The code block in testdomjquery/todo/test/client/tasks-test.js will not fail. The xhr should give a response before expect is called, and the callcount should be 1, i.e. … | |||
| 181 | SUGGEST | The code block at the end of the page does not do what it’s supposed to: verify that updateMessage function called the getTasks function. The original code block Code that would work | |||
| xiv | TYPO | “client-side (including jQuery and Angluar)” Should be: | |||
| 6 | TYPO | “Automated testability is a design issue.” should be: Markdown syntax for italic text had been forgotten to the formatted text. That should either be marked with italic font style, and/or _ characters should be removed. | |||
| 181 | ERROR | mock set up in test doesn’t verify anything:- testdomjquery/todo/test/client/tasks-test.js should be:- var getTasksMock = sandbox.mock(window).expects(‘getTasks’).once(); | |||
| 103 | SUGGEST | Thanks, book is great, but Yahoo Finance has changed their API, and examples does not work anymore my workaround is: changed node module “http” to “https” and api links: http to | |||
| xvii | SUGGEST | In the third paragraph under the topic, Your Own Workspace, getting to the tdjsa directory is not fully explained. The tdjsa.zip with the workspace is embedded in the code directory from the download file, vsjavas-code.zip. More explanation of this would prevent us from starting in the code solutions section. | |||
| 20 | TYPO | “That also raises a few question” -> should be “a few questions” | |||
| 13 | SUGGEST | On page 13 (Kindle) the code in the unit test should be the same as on page 19 (Kindle): it(‘should pass this canary test’, function() { expect(true).to.eql(true); }); should be it(‘should pass this canary test’, function() { expect(true).to.be.true; }); | |||
| 263 | ERROR | There are issues related to the given source code related to Chapter 9 (Test-Drive Angular 2). The tests fail (running ‘npm test-client’) with “Uncaught ReferenceError: ng is not defined”. There are two main issues related to dependencies (package.json) and karma setup (karma.conf.js): 1. package.json dependencies seem to have incompatible versions 2.karma.conf.js erroneously references ‘./public/javascripts/X’ when the packages are actually in ‘node_modules/X’ | |||
| 189 | ERROR | Given the following code on page 189: it(‘ajax should set dataType to text’, function() { jCallService({method: ‘POST’, url: ‘/tasks’, data: ‘…some data…’}); The expectation expect(options.dataType).to.be.eql(‘text’); is useless. Replace the string ‘text’ with anything you want and the test is still passing ! Suggestion: replace it with a stub, and remove the sandbox.verify, as follows: it(‘ajax should set dataType to text’, function() { jCallService({method: ‘POST’, url: ‘/tasks’, data: ‘…some data…’}); - MCameriere |