I hereby claim:
- I am mars on github.
- I am marsi (https://keybase.io/marsi) on keybase.
- I have a public key whose fingerprint is DFC9 5BAD 42CF D15F 589A 9436 7F70 7FA1 F236 B857
To claim this, I am signing this object:
module.exports = { | |
WEBPACK_ENV: JSON.stringify('development'), | |
FOO: JSON.stringify('per-environment foo value') | |
}; |
/* | |
Insert a Promise into a pre-defined Promise chain. | |
@param promiseBlock [Function] takes a Promise | |
parameter & returns the continuation of that parameter. | |
@return [Promise] the fullfilled Promise chain | |
*/ | |
function wrapPromise(promiseBlock) { | |
if (typeof promiseBlock !== 'function') { | |
throw new Error('promiseBlock must be a Function'); |
var webpackModule = require('./webpack.module.js'); | |
var webpackResolve = require('./webpack.resolve.js'); | |
var Webpack = require('webpack'); | |
var RewirePlugin = require("rewire-webpack"); | |
module.exports = function(config) { | |
config.set({ | |
// frameworks to use | |
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
/* | |
Jasmine helper to stub & teardown a bunch of a module's dependencies. | |
describe("SomeModule", function() { | |
var SomeModule = rewire("some-module"); | |
rewireModule(SomeComponent, { | |
ItsComponent: React.createFactory('div'), | |
AnotherComponent: React.createFactory('div') |
# Ancestor for JSON-API serializers, implements | |
# "application/vnd.api+json" media type conventions. | |
# | |
# See: http://jsonapi.org | |
# | |
class JsonApiSerializer < ActiveModel::Serializer | |
# Always make pluralized root JSON property. | |
# | |
def self.inherited(subclass) |
# Monkey-patch on Capybara!!! | |
# | |
class Capybara::Selenium::Driver < Capybara::Driver::Base | |
# Patch to avoid `@browser.navigate.to('about:blank')` which hangs sometimes. | |
# | |
def reset! | |
# Use instance variable directly so we avoid starting the browser just to reset the session | |
if @browser | |
begin @browser.manage.delete_all_cookies |
I hereby claim:
To claim this, I am signing this object:
Capybara.register_driver :chrome do |app| | |
Capybara::Selenium::Driver.new(app, | |
browser: :chrome, | |
desired_capabilities: { | |
"chromeOptions" => { | |
"args" => %w{ window-size=1024,768 } | |
} | |
} | |
) | |
end |
// give each tested app its own DOM element | |
document.write('<div class="ember-testing-container"><div id="foo-app-testing"></div></div>'); | |
FooApp.rootElement = '#foo-app-testing'; | |
// defer readiness | |
FooApp.setupForTesting(); | |
module("Foo App", { | |
setup: function() { | |
FooApp.injectTestHelpers(); | |
// last step, before each test begins, clears the container and advances readiness |
Ember.Test.registerHelper('selectFrom', | |
function(app, selector, value, description) { | |
// choose an option | |
find(selector).val(value); | |
// trigger the change | |
find(selector).change(); | |
// assert the selected option | |
equal(find(selector+" option:selected").val(), value, description||"makes the selection"); | |
// promise | |
return wait(); |