jmcooper / angular-hogwarts-tdd-kata Goto Github PK
View Code? Open in Web Editor NEWAngularJS TDD Kata
AngularJS TDD Kata
Currently all the extra stories below would take too long to finish (30 minutes).
I am wondering if we could identify one from our current work that is short (about 10 minutes)
To simplify (and speed up) TDD training I often combine tests and code in the same file.
Our problem inherently has our students working in 3 pages, 2 modules, 2 repositories, and a couple of services with tests for some of these.
Combining the natural complexity of the problem with the extra files and directories some of which they don't need to know about (eg., index.html, css/, lib/, app.js, route.js), has me worried for the student.
I think we have done a great job removing complexities like bower, node, and grunt.
I am still looking for ways to simplify the users experience.
The goal of this run through is to
To help with courage, I would ask for Dave's help. It won't bother him if it is a complete disaster. He will also spice up the language and make it more fun.
You will have to check with Mike to see if it is available. If not grab 2 - 3 people and run through it in the hall.
Good luck!
This will allow us the ability to unstick a stuck student. We will find out where they are hand checkout the tag.
This will need to be done as one of the last things we do (I think).
When you use sinon in the way we are using it, the mocked object must exist.
This needs to be added to the workflow in the readme.
We need 5 thumb drives with
Anything else?
I like the artistic license for katas.
I like how we are showing where to put the code by showing the context with ellipsis (...), but sometimes when there are multiple things to add, the student could easily miss something. Is there a way to highlight the new code in red or something that makes it obvious what the new code is?
Amy, you need to set your code editor to convert tabs to spaces. (I hope this is the pluralsite standard :-) )
Additionally, the code you submitted needs to formated to all spaces.
It took Kay one min to clone the repository on our fast network. Amy will lose the room at Software Craftsmanship.
Just deleting the files well not speed up the clone. They will need to be permanently deleted.
Good luck everyone, I will ping you next weekend.
We need a starting point for the student to download.
We need a consistent style for the project. For example, I was using single var with different comma styles. While Jim is using Node.js style of multiple vars.
Here is a style guide that helps a bit: http://seravo.fi/2013/javascript-the-winning-style
Another example, two spaces for indentation would give us less horizontal scrolling.
I am planning on moving the source implementation to
wip/Tests
wip/App
Removing client
so the attendees only see
app/
tests/
wip/
I am not sure what to do with setup/
I am pretty sure the students won't need it.
Many people programming Angular JS will be using a non windows machine Mac, Unix.
We should standardize our line ending to LF (see https://help.github.com/articles/dealing-with-line-endings)
The package should point to our repo, our license and us.
While creating this Kata, I have been thinking about the different TDD styles. London will get you a lot of small classes quickly. Tell Don't Ask works great in this style. A breadth first coding style that requires Acceptance Tests to make sure everything is wired up correctly.
On the other hand, Detroit has a depth first feel to it. Designs evolve classes more slowly and require the developer to understand the code smells that drive creation of new classes. Fewer AT are required because, these tests function as class integration tests. Only the boundary of a slow resource is stubbed and therefore fewer boundary bugs.
My next experiment will be to start with London Style and as I need to modify my tests because of refactoring/adding code I will convert the tests into Detroit Style. One rule I will follow strictly: Never mix styles in a single tests (that means mocks for LS and stubs for DS).
I am not sure we have time to experiment with this Kata for AgileRoots but I am thinking about it.
With many people using non windows, machines, we should probably provide a Node Server if we require a server.
There is a bug in the code where it is checking to see if the course ids are equal instead of checking to see if the start times are equal (I probably introduced this when switching to underscore). Unfortunately the test is passing even though the code is wrong.
Many people programming Angular JS will be using a non windows machine Mac, Unix.
We should standardize our line ending to LF (see https://help.github.com/articles/dealing-with-line-endings)
Kay was having trouble with the npm install on windows. We may need the server.exe on the thumb drive.
We may need node_modules build for windows.
Instead of using the array syntax (for minification reasons), use the more simple syntax for constructing controllers and services.
I am guessing to remove this duplication, you would create a directive.
Can we create this test first?
Is it worth putting in the kata?
I will be out of town the week of software craftsmanship.
As I work through, this example I find people having trouble finding the directories and files. I think we can simplify this again by putting tests inside directories with code.
We have multiple test 1. We could fix this with a story number and test number like the following:
Story 1: Show Course Catalog
1.1 Test Failing
1.1 Test Passing
2.1 Test Failing
The introduction should be short but interesting.
We are using Course and classes interchangeably, I think we should only have one.
Course is not a reserved word and thus would work better.
If felt a little funny getting all the courses from the CatalogRepository
and then iterating over them to find the one I want. Something about Single Responsibility or Tell Don't Ask or Cohesion & Coupling. Or code smell: Inappropriate Intimacy.
I feel like there should be afindById
on the repository.
See Register for courses : Test 3
After we are happy with the Kata, I want to copy it to another repository, Thus loosing all the extra commits we currently have.
This will eliminate any extra checkins (downloading extra files) and people won't know how hard we worked on it. :-)
The wip directory will exist here and not exist there.
jasmine's expect
give a message about truthy
sinon.assert.calledWith
will let you know which parameters don't match
Also notice sinon is even shorter:
expect(mock.get.calledWith(0, houseOptions.length - 1)).toBeTruthy();
sinon.assert.calledWith(mock.get, 0, houseOptions.length - 1);
Inquiring minds would like to know why we are using expect
.
Last nights changes broke all the tests.
I think this has to do with renaming the Services.
Here is an example stack trace:
Chrome 35.0.1916 (Mac OS X 10.9.3) HouseAssignmentService when assigning a wizard to a house gets the wizard from the repository FAILED
Error: [$injector:unpr] Unknown provider: HouseAssignmentServiceProvider <- HouseAssignmentService
http://errors.angularjs.org/1.2.16/$injector/unpr?p0=HouseAssignmentServiceProvider%20%3C-%20HouseAssignmentService
at /Users/zhon/dev/trash/angular-hogwarts-tdd-kata/app/lib/angularjs/angular.min.js:78:20
at /Users/zhon/dev/trash/angular-hogwarts-tdd-kata/app/lib/angularjs/angular.min.js:3705:27
at Object.getService [as get] (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/app/lib/angularjs/angular.min.js:3832:53)
at /Users/zhon/dev/trash/angular-hogwarts-tdd-kata/app/lib/angularjs/angular.min.js:3710:53
at getService (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/app/lib/angularjs/angular.min.js:3832:53)
at Object.invoke (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/app/lib/angularjs/angular.min.js:3859:31)
at workFn (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/test/lib/angular-mocks.js:2144:34)
at window.inject.angular.mock.inject (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/test/lib/angular-mocks.js:2130:45)
at null.<anonymous> (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/test/sorting/house-assignment-service-specs.js:12:9)
Error: Declaration Location
at window.inject.angular.mock.inject (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/test/lib/angular-mocks.js:2129:33)
at null.<anonymous> (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/test/sorting/house-assignment-service-specs.js:12:9)
TypeError: Cannot read property 'get' of undefined
at null.<anonymous> (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/test/sorting/house-assignment-service-specs.js:28:33)
TypeError: Cannot read property 'get' of undefined
at null.<anonymous> (/Users/zhon/dev/trash/angular-hogwarts-tdd-kata/test/sorting/house-assignment-service-specs.js:36:57)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.