Git Product home page Git Product logo

backbone-koans's Introduction

Backbone Koans

A set of jasmine powered koans for learning Backbone.js.

The koans verify behavior of a Todo list app, a modified version of the original Todos app created by Jérôme Gravel-Niquet.

How to Run

Start a local http server from the backbones folder:

python -m SimpleHTTPServer
(or 'python3 -m http.server' for python 3 users)

http://localhost:8000/

Some browsers such as Chrome don't like you making some json requests through the 'file' protocol, so just opening specrunner.html directly from a browser is not recommended.

On opening the localhost:8000 page in the browser you will see many failing specs. Work your way through the jasmine specs in the js/koans directory, and when you finish you should have a better understanding of how to create and test a Backbone app.

backbone-koans's People

Contributors

aeosynth avatar gregmalcolm avatar larrymyers avatar lpmi-13 avatar plagelao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backbone-koans's Issues

bind('all') koan

Hi there,

I'm doing your koans (great work, by the way, thanks a lot!) but I'm stuck at the bind('all') one:

https://github.com/larrymyers/backbone-koans/blob/master/js/koans/aboutEvents.js#L66

The solution should be obj.trigger("custom event");, but it doesn't work. It triggers two events instead of one, so first assertion is not valid.

I'm I doing something wrong? This is my code:

it("Evented objects can bind 'all' as a special event name to capture all triggered events on the object.", function() {
  var callback = jasmine.createSpy('-Custom Event Callback-');

  obj.bind('all', callback);

  obj.trigger("custom event");

  expect(callback.callCount).toBe(1);
  expect(callback.mostRecentCall.args[0]).toBe('custom event');
});

Cannot use 'in' operator to search for 'id' in text

Hi,

I can't seem to work out why the following code is throwing an error:

it('Attributes can be set on the model instance when it is created.', function() {
    var todo = new Todo({ text: 'Get oil change for car.' });
    var expectedText = 'FIX ME';
    todo.set('text',"FIX ME");
    expect(expectedText).toEqual(todo.get('text'));
});

The console states: TypeError: Cannot use 'in' operator to search for 'id' in text -> koans/aboutModels.js:24

Any idea where I've gone wrong?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.