just looking through golang's testing category and making conclusions about what to use.
- go's
testingpackage is good for starters. libs provide more expressive APIs.
- Andrew Gerrand's testing presentation is helpful
- use testify for assertions.
just looking through golang's testing category and making conclusions about what to use.
testing package is good for starters. libs provide more expressive
APIs.| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName:'Ember Twiddle' | |
| }); |
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName:'Ember Twiddle' | |
| }); |
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| people: [ | |
| { | |
| name: 'jason' | |
| }, | |
| { |
| function explicit(ctx, fn) { | |
| return function() { | |
| try { | |
| const result = fn.apply(ctx, arguments) | |
| return [null, result] | |
| } catch (err) { | |
| return [err, null] | |
| } | |
| } |
| const co = require('co') | |
| const request = require('superagent') | |
| const atob = require('atob') | |
| const btoa = require('btoa') | |
| const sleep = require('co-sleep') | |
| const token = process.env.TOKEN | |
| if (!token) throw new Error('need token') |
| // seeing if github always returns a 409 conflict - seems like it does | |
| // this is also a good way of teasing out github's error responses, which are undocumented (or i haven't browsed the docs carefully enough) | |
| const co = require('co') | |
| const request = require('superagent') | |
| const sleep = require('co-sleep') | |
| const btoa = require('btoa') | |
| const token = process.env.TOKEN |
| #!/bin/sh | |
| # | |
| # This script imports node modules into your app without the use of | |
| # ember-browserify. To use, | |
| # | |
| # $ ./wrap_node_module.js | |
| # | |
| # (For the sake of an example, I use Lodash below.) | |
| # |
| # Prerequisits | |
| * ffmpeg (brew install ffmpeg) | |
| * imagemagick (brew install imagemagick) | |
| # Steps | |
| 1. Use quicktime to capture your video and save it | |
| 2. `ffmpeg -i source.mov -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - output.gif` |
| import Ember from 'ember'; | |
| import run from 'ember-runloop'; | |
| /** | |
| * Copied from https://github.com/cibernox/ember-power-select/blob/master/test-support/helpers/ember-power-select.js | |
| */ | |
| function fireNativeMouseEvent(eventType, selectorOrDomElement, options = {}) { | |
| let event = new window.Event(eventType, { bubbles: true, cancelable: true, view: window }); | |
| Object.keys(options).forEach((key) => event[key] = options[key]); | |
| let target; |