Git Product home page Git Product logo

angular-debaser's People

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  avatar  avatar  avatar  avatar

angular-debaser's Issues

use with npm?

Use with npm/browserify? I noticed that private is set to true in the package.json file. Would you publish this to npm and support CommonJS?

alias occurrences of "object" to "obj"

it's shorter and pretty obvious.

pretty sure I built in support for this sort of thing. the Sinon functions are all aliased to func so should not be a rabbit hole.

First Object not stubbed

I've discovered an issue in my code where the first object to be declared in a debaser chain is not stubbed:

beforeEach(function () {
      debaser()
          .module('lander')
          .object('$location', {first: "first"})
          .object('$window', { lander_gon: { searchKeywords: "Test Keyword", searchLocation: "Test City" }, location: { replace: sinon.stub() } })
          .debase();
    });

logging these objects from the application code shows that $location is the actual implementation:

Tb {$$protocol: "http", $$host: "server", $$port: 80, $$parse: function, $$compose: function…}

However, if I add any other declaration before it:

    beforeEach(function () {
      debaser()
          .module('lander')
          .object('$location', {first: "first"})
          .object('$location', {second: "second"})
          .object('$window', { lander_gon: { searchKeywords: "Test Keyword", searchLocation: "Test City" }, location: { replace: sinon.stub() } })
          .debase();
    });

I get:

 Object {second: "second"}

This is not limited to the location object (I first noticed it with $window).

This is occurring with Jasmine 2.0.2, angular-debaser 0.3.2

when stubbing existing module, overwrite constants

I'm kicking myself for not filling out the description before, but I believe what's happening is if you stub an existing module, and provide a constant with the name of an existing constant, you get the real one.

update docstrings

We need a lot of docstrings to get the API documentation (jsdoc) usable.

constant api

I don't really dig on the constant api:

// module with constant object bar
module('foo').withObject('bar', {baz: 'quux'})

We don't need explicit modules. anonymous modules are fine. we should just be able to provide:

  1. constantObject() convenience method
  2. constantFunc() convenience method
  3. constant() method which has more power
  4. potentially an options parameter to func and object in which you can define either of these as constants

test with Jasmine, somehow

I wonder if there's a way to run the tests using Jasmine and Mocha+Chai easily. The syntax is slightly different, of course, and I'm not sure how well the Sinon assertions will hold up.

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.