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
import chai, { expect } from 'chai'; | |
import spies from 'chai-spies'; | |
import when from 'when'; | |
import wire from 'essential-wire'; | |
import wireDebugPlugin from 'essential-wire/source/debug'; | |
import routingSystemPlugin from '../../src/server/plugins/routing/crossroads'; | |
chai.use(spies); |
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
import React from 'react'; | |
import { render } from 'react-dom'; | |
import Interactive from './interactive' | |
const activateCallback = () => { | |
console.log("activateCallback invoked"); | |
} | |
export default class Application extends React.Component { | |
render() { |
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
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
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
var ItemsRouter = Router.createClass([ | |
{ | |
route: 'items.length', | |
get: () => { | |
return {path: ['items', 'length'], value: data.items.length} | |
} | |
} | |
]); |
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
var app = require('../../server/app.js'); | |
var model = require('../../model.js'); | |
var request = require('supertest'); | |
var apitest = request(app); | |
describe('integration', function () { | |
it('model.json post should throw 500 error without args', function (done) { | |
apitest.post('/model.json') | |
.expect(500, done); |
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
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
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
var makeSealer = function () { | |
var users = [], passwords = []; | |
return { | |
sealer: function (username, password) { | |
var i = users.length, | |
user = {username: username}; | |
users[i] = user; | |
passwords[i] = password; | |
return user; |
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
define -> | |
runTask = () -> | |
task = Array::slice.call(arguments, 0, 1) | |
rest = Array::slice.call(arguments, 1) | |
@[task].apply @, rest |
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
getRandomInt = (min, max) -> | |
return Math.floor(Math.random() * (max - min + 1)) + min |