Skip to content

Instantly share code, notes, and snippets.

View joachimhs's full-sized avatar

Joachim Haagen Skeie joachimhs

View GitHub Profile
Montric.ChartView = Ember.View.extend({
classNames: ['eurekajChart'],
resizeHandler: null,
nvd3Chart: null,
contentObserver: function() {
console.log('ChartView contentObserver!');
var elementId = this.get('elementId');
var series = this.get('chart.series');
console.log('series: ' + series);
auto eth0
iface eth0 inet static
address 192.168.1.202
netmask 255.255.255.0
gateway 192.168.1.1
#auto br0
#iface br0 inet static
# address 192.168.1.202
# netmask 255.255.255.0
contentArrayContains: function(id, type) {
var contains = null;
Ember.get(type, 'collection').forEach(function(item) {
if (item.get('id') === id) {
contains = item;
}
});
return contains;
var alertAdminController;
module("EurekaJ.AdministrationAlertsController", {
setup: function() {
this.server = sinon.fakeServer.create();
Ember.run(function() {
alertAdminController = EurekaJ.__container__.lookup("controller:administrationAlerts");
});
@joachimhs
joachimhs / gist:5280678
Last active December 15, 2015 15:19
Sinon FakeServer test
var alertAdminController;
module("EurekaJ.AdministrationAlertsController", {
setup: function() {
this.server = sinon.fakeServer.create();
Ember.run(function() {
alertAdminController = EurekaJ.__container__.lookup("controller:administrationAlerts");
});
@joachimhs
joachimhs / gist:5278104
Created March 30, 2013 19:54
Simple QUnit test
var appController;
var inputDate = new Date(2013,2,27,11,15,00);
module("EurekaJ.AppController", {
setup: function() {
Ember.run(function() {
appController = EurekaJ.__container__.lookup("controller:application");
});
},
@joachimhs
joachimhs / gist:5273519
Created March 29, 2013 20:44
run-qunit.js
var interval = null;
var args = phantom.args;
if (args.length < 1 || args.length > 2) {
console.log("Usage: " + phantom.scriptName + " <URL> <timeout>");
phantom.exit(1);
}
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
if (msg.slice(0, 8) === 'WARNING:') {
Even though JavaScript have matured significantly over the last five years, there is still a couple of areas where you will most definitely notice that you are working with a project that still have some maturing to do. Testing is definitely one of these areas, leaving a lot of the decisions required up to the application developers. This chapter will attempt to outline how you can successfully test your own Ember.js applications while looking at a real world implementation of one possible test harness.
As with applications written in other languages, there are multiple way to test your application, including:
• Unit Testing
• Integration Testing
• Performance Testing
• Regression Testing
• Black Box Testing
• Continuous Integration
Naturally, you might not need to implement a solution for all of these testing types in your own application. Chances are, though, that you might need several of them, where unit testing and integration testing are the most common types of test harnesses you will find f
@joachimhs
joachimhs / gist:5253672
Created March 27, 2013 11:58
assembled
This file has been truncated, but you can view the full file.
/*
* Date Format 1.2.3
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
* MIT license
*
* Includes enhancements by Scott Trenda <scott.trenda.net>
* and Kris Kowal <cixar.com/~kris.kowal/>
*
* Accepts a date, a mask, or a date and a mask.
* Returns a formatted version of the given date.
@joachimhs
joachimhs / gist:5253158
Created March 27, 2013 10:06
QUnit test
var appController;
module("EurekaJ.AppController", {
setup: function() {
appController = EurekaJ.ApplicationController.create();
},
teardown: function() {
}
});