Skip to content

Instantly share code, notes, and snippets.

@perryhoffman
Created December 19, 2017 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perryhoffman/3f00c6b5c2ed8d4741a2b84899add0f8 to your computer and use it in GitHub Desktop.
Save perryhoffman/3f00c6b5c2ed8d4741a2b84899add0f8 to your computer and use it in GitHub Desktop.
Account Service Unit Test Base
'use strict'
describe('accountService', function () {
let accountService
let accountServiceProviderMock, gettextCatalog, configService
beforeEach(() => {
module("arkclient.accounts", $provide => {
accountServiceProviderMock = {}
gettextCatalog = {}
configService = { notice: sinon.stub(), getByGroupAndKey: sinon.stub() }
// inject the mock services
$provide.value('accountServiceProvider', accountServiceProviderMock)
$provide.value('gettextCatalog', gettextCatalog)
$provide.value('configService', configService)
$provide.value('ARKTOSHI_UNIT', Math.pow(10, 8))
})
inject($injector => {
accountService = $injector.get('accountService')
})
})
describe('createSendTransaction', function () {
it('just test that I can test the service...', function () {
console.log('create tx method ', accountService.createTransaction)
expect(typeof accountService.createTransaction).to.eql('function')
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment