Git Product home page Git Product logo

kinvey-angular-mock's Introduction

kinvey-angular-mock

Mock Kinvey's official $kinvey AngularJS service in unit tests.

Psst... We also provide Kinvey's official Angular library on bower here.

Usage

Simply inject the mock module to override the $kinvey service with the mock $kinvey service:

describe('kinvey-mock module', function() {

    beforeEach(function() {
        // this module will replace the real $kinvey service
        module('kinvey-mock');
    });

    it('should provide the mocked $kinvey service', function() {
        var $kinvey = $injector.get('$kinvey');

        $kinvey.ping().then(function(response) {
            expect(response.appName).toBe("Mock App");
        });
    });
});

Support

Module Members

  • $kinvey.API_ENDPOINT
  • $kinvey.API_VERSION
  • $kinvey.SDK_VERSION

Module Methods

  • $kinvey.getActiveUser()
  • $kinvey.init()
  • $kinvey.ping()

Classes

Kinvey.Acl

Assuming var acl = new $kinvey.Acl(<entity>);:

  • acl.addReader()
  • acl.addReaderGroup()
  • acl.addWriter()
  • acl.addWriterGroup()
  • acl.getCreator()
  • acl.getReaderGroups()
  • acl.getReaders()
  • acl.getWriterGroups()
  • acl.getWriters()
  • acl.isGloballyReadable()
  • acl.isGloballyWritable()
  • acl.removeReader()
  • acl.removeReaderGroup()
  • acl.removeWriter()
  • acl.removeWriterGroup()
  • acl.setGloballyReadable()
  • acl.setGloballyWritable()
  • acl.toJSON()

Kinvey.Query

Assuming var query = new $kinvey.Query();:

  • query.and()
  • query.ascending()
  • query.contains()
  • query.containsAll()
  • query.descending()
  • query.equalTo()
  • query.exists()
  • query.fields()
  • query.greaterThan()
  • query.greaterThanOrEqualTo()
  • query.lessThan()
  • query.lessThanOrEqualTo()
  • query.limit()
  • query.matches()
  • query.mod()
  • query.near()
  • query.nor()
  • query.notContainedIn()
  • query.notEqualTo()
  • query.or()
  • query.size()
  • query.skip()
  • query.sort()
  • query.toJSON()
  • query.withinBox()
  • query.withinPolygon()

Namespaces

Kinvey.DataStore

  • $kinvey.DataStore.clean()
  • $kinvey.DataStore.count()
  • $kinvey.DataStore.destroy()
  • $kinvey.DataStore.find()
  • $kinvey.DataStore.get()
  • $kinvey.DataStore.group()
  • $kinvey.DataStore.save()
  • $kinvey.DataStore.update()

Kinvey.File

  • $kinvey.File.upload(file)
  • $kinvey.File.destroy(fileId)
  • $kinvey.File.stream(fileId)

Kinvey.User

  • $kinvey.User.count()
  • $kinvey.User.create()
  • $kinvey.User.destroy()
  • $kinvey.User.exists()
  • $kinvey.User.find()
  • $kinvey.User.forgotUsername()
  • $kinvey.User.get()
  • $kinvey.User.group()
  • $kinvey.User.login()
  • $kinvey.User.loginWithProvider()
  • $kinvey.User.logout()
  • $kinvey.User.me()
  • $kinvey.User.resetPassword()
  • $kinvey.User.restore()
  • $kinvey.User.signup()
  • $kinvey.User.signupWithProvider()
  • $kinvey.User.update()
  • $kinvey.User.verifyEmail()

TODO

PRs welcome!

Module Methods

  • $kinvey.execute(id, args, options)
  • $kinvey.setActiveUser(user)

Classes

Kinvey.Error

Kinvey.Group

Kinvey.Metadata

Namespaces

Kinvey.Defer

Kinvey.Social

Kinvey.Sync

Development

  1. Fork repo.
  2. Create feature branch.
  3. Edit /src code.
  4. Increment bower.json version.
  5. Run gulp build.
  6. Submit a PR.

Need more help? Ask away on the issue queue, thanks!

kinvey-angular-mock's People

Contributors

levithomason avatar jskrzypek avatar

Watchers

James Cloos avatar  avatar  avatar

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.