Just playing around. It won't be bulletproof, but enough to do some basics.
A Pen by Aaron Barker on CodePen.
fun <Input, Output> processWithReactor( | |
vertx: Vertx, | |
inputStream: ReadStream<Input>, | |
outputStream: WriteStream<Output>, | |
processor: (Flux<Input>) -> Flux<Output> | |
) { | |
val publisher = ReactiveWriteStream.writeStream<Input>(vertx) | |
inputStream.pipeTo(publisher) | |
val writeStreamFlux = Flux.from(publisher) |
Just playing around. It won't be bulletproof, but enough to do some basics.
A Pen by Aaron Barker on CodePen.
// Chai | |
expect({ a: 1 }).to.deep.equal({ a: 1 }); | |
expect({ a: 1 }).not.to.deep.equal({ a: 2 }); | |
// Jest / jasmine | |
expect({ a: 1 }).toEqual({ a: 1 }); | |
expect({ a: 1 }).not.toEqual({ a: 2 }); |
expect(json).toMatchSnapshot(); |
// Make sure chai and jasmine ".not" play nice together | |
const originalNot = Object.getOwnPropertyDescriptor(chai.Assertion.prototype, 'not').get; | |
Object.defineProperty(chai.Assertion.prototype, 'not', { | |
get() { | |
Object.assign(this, this.assignedNot); | |
return originalNot.apply(this); | |
}, | |
set(newNot) { | |
this.assignedNot = newNot; | |
return newNot; |
global.jestExpect = global.expect; | |
global.expect = chai.expect; |
expect({ a: 1 }).to.deep.equal({ a: 1 }); | |
jestExpect({ a: 1 }).toEqual({ a: 1 }); |
// Usage: import makeTypeDef from './graphql-schema-creator.js'; | |
// makeTypeDef('mynewtype', myTypeValue); | |
import { | |
GraphQLObjectType, | |
GraphQLNonNull, | |
GraphQLSchema, | |
GraphQLString, | |
GraphQLList, | |
GraphQLInt, |