Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock/spy/stub module #716

Open
legendecas opened this issue May 14, 2019 · 2 comments
Open

mock/spy/stub module #716

legendecas opened this issue May 14, 2019 · 2 comments

Comments

@legendecas
Copy link
Contributor

legendecas commented May 14, 2019

Is your feature request related to a problem? Please describe.
Provides a mock/spy/stub module natively in yodart.

Describe the solution you'd like

var esp = require('@yodaos/espionage')

var target = {
  tweet: () => { 
    return 'foobar'
  }
}
var spy = esp.spy(target, 'foo')
target.tweet('foo', 'bar')
spy.calledWith('foo', 'bar')
spy.returned('foobar')
@yorkie
Copy link
Member

yorkie commented May 14, 2019

How about integrating sinonjs instead of re-implementing it? And sinon supports fake timers which could be used in testing with our alarm/reminder.

@yorkie
Copy link
Member

yorkie commented May 14, 2019

Ping @yodaos-project/js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants