Create a spy
// "bare" spy
var spy = jasmine.createSpy('spyName');
// Mock object of spies: spy.next(), spy.current(), etc
module.exports = function (config) { | |
'use strict'; | |
config.set({ | |
basePath: '', | |
preprocessors: { | |
'assets/tests/**/*.js': ['webpack'], // our specs | |
'assets/js/**/*.js': ['webpack'], // our components |
β¦specifically React 0.13 using ES6 class syntax
Originally I was implementing the validator as a context, but then I got stung by parent context vs owner context. I'll likely return to the context model when React's context implementation is more final (looks like they're moving towards parent context over owner context, which I'd prefer).
import provideIntl from './provideIntl'; | |
import ReactIntl from 'react-intl'; | |
const components = {}; | |
export default components; | |
// FormattedMessage, FormattedNumber, FormattedRelative, FormattedDate | |
Object.keys(ReactIntl).forEach(key => { | |
components[key] = provideIntl(ReactIntl[key]); | |
}); |
### Keybase proof | |
I hereby claim: | |
* I am andrewk on github. | |
* I am andrew (https://keybase.io/andrew) on keybase. | |
* I have a public key ASCxw9Pg4zFREfvoBsCnNQoawhSlSZb5J2z4DsVHbpoSEgo | |
To claim this, I am signing this object: |