Created
March 17, 2017 02:35
-
-
Save nrjpoddar/79039078d897831d42e6b72c45553928 to your computer and use it in GitHub Desktop.
Sample code for monkey patching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const transformer = require('transformer'); | |
class MockClient { | |
constructor() { this._msg = null; } | |
put(msg) { this._msg = msg; } | |
getMsg() { return this._msg; } | |
} | |
describe('test-transformer', function(done) { | |
it('putsData', function(data) { | |
let t = new transformer('testCode'); | |
t._client = new MockClient(); | |
t.puts('I am testing transformer I think?!'); | |
assert.expects(m.getMsg(), 'I am testing transformer for sure!' + 'Hello from testCode'); | |
done(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
transformer-updated