Skip to content

Instantly share code, notes, and snippets.

View robksawyer's full-sized avatar
🎯
Focusing

Rob Sawyer robksawyer

🎯
Focusing
View GitHub Profile
error: The bootstrap function threw an error after its callback was called :: Error: done() called multiple times
at Hook.Runnable (/Users/testing/Sites/node_modules/mocha/lib/runnable.js:48:17)
at new Hook (/Users/testing/Sites/node_modules/mocha/lib/hook.js:22:12)
at Suite.beforeAll (/Users/testing/Sites/node_modules/mocha/lib/suite.js:170:14)
at context.before (/Users/testing/Sites/node_modules/mocha/lib/interfaces/bdd.js:37:17)
at Object.<anonymous> (/Users/testing/Sites/test/bootstrap.test.js:11:1)
at Module._compile (module.js:456:26)
at Module._extensions..js (module.js:474:10)
at Object.Module._extensions..js (/Users/testing/Sites/node_modules/istanbul/lib/hook.js:102:13)
at Module.load (module.js:356:32)
@robksawyer
robksawyer / UserController.test.js
Created November 26, 2014 08:01
appHelper.fixtures = null
var sails = require('sails'),
sinon = require('sinon'),
assert = require('assert'),
request = require('supertest'),
appHelper = require('../../helpers/appHelper'),
agent = request.agent('http://localhost:1337');
before(function(done){
appHelper.lift(done);
});
error: Sending 500 ("Server Error") response:
Error (E_VALIDATION) :: 1 attribute is invalid
at WLValidationError.WLError (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/error/WLError.js:33:18)
at new WLValidationError (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/error/WLValidationError.js:20:28)
at /usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/validate.js:45:43
at allValidationsChecked (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:195:5)
at done (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:135:19)
at /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:32:16
at validate (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/core/validations.js:135:49)
at /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:125:13
var request = require('supertest'),
expect = require('chai').expect,
login = require("./../../helpers/login"),
_ = require('lodash'),
Barrels = require('barrels'),
barrels = new Barrels(),
fixtures = barrels.data;
describe('AuthController', function AuthController() {
@robksawyer
robksawyer / gist:8ae8eaca8424ece45ac9
Created December 5, 2014 06:53
The Sails Lifter
/*
* Location: /test/helpers/theLifter.js
*
* @description :: Provides 'lift' and 'lower' methods to set up
* and tear down a Sails instance (for use in tests)
*/
'use strict';
var SailsApp = require('sails').Sails,
async = require('async'),
lifted = false,
/**
* Mocha bootstrap file for backend application tests.
*/
'use strict';
var theLifter = require('./helpers/theLifter');
/**
* Mocha bootstrap before function, that is run before any tests are being processed. This will lift sails.js with
* test configuration.
@robksawyer
robksawyer / theLifter.js
Last active August 29, 2015 14:11
Helps to lift SailsJS for tests.
/*
* Location: /test/helpers/theLifter.js
*
* @description :: Provides 'lift' and 'lower' methods to set up
* and tear down a Sails instance (for use in tests)
*/
'use strict';
var SailsApp = require('sails').Sails,
async = require('async'),
lifted = false,
@robksawyer
robksawyer / MicControlC.cs
Last active August 29, 2015 14:20
MicInput Javascript to C# Conversion
using UnityEngine;
using System.Collections;
//The GameObject requires a AudioSource component
[RequireComponent (typeof(AudioSource))]
public class MicControlC : MonoBehaviour
{
private string selectedDevice;
@robksawyer
robksawyer / Frequency Analysis
Last active August 29, 2015 14:20
Scripts from an answer related to frequency analysis in Unity 3D. http://answers.unity3d.com/questions/175173/audio-analysis-pass-filter.html
// Converted from UnityScript to C# at http://www.M2H.nl/files/js_to_c.php - by Mike Hergaarden
// Do test the code! You usually need to change a few small bits.
using UnityEngine;
using System.Collections;
public class FrequencyAnalyzer : MonoBehaviour {
private float[] freqData;
private int nSamples = 1024;
private float fMax;
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
//[RequireComponent(typeof(AudioSource))]
[RequireComponent(typeof(GUITexture))]
public class AudioWaveFormVisualizer : MonoBehaviour
{
public AudioSource MusicPlayer;