Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am orourkek on github.
  • I am korourke_sg (https://keybase.io/korourke_sg) on keybase.
  • I have a public key ASAnMDdc30lXoafTUh3qnmJAZQk5LZUliGLH9Ekv7aOU4wo

To claim this, I am signing this object:

@orourkek
orourkek / instructions.md
Created March 11, 2019 21:52
Grab flatuicolors.com palette as sass variables

In my last blog on this topic, I claimed that the choice to use RequireJS handcuffed you to the less than awesome experience of using a browser based test runner. I was wrong! Surprised? Yeah, me neither.

I describe my ideal testing experience to be this: Anytime something changes, my personal robot army runs unit tests and tells me what I broke without me having to lift a god damned finger. I'm a programmer, I'm lazy, that's why I do this; so I can automate my life, my code, my income, and just retire to an island while my robots run shit. I'm not quite there yet, but this is here to share with you, how I finally figured out step 1337 of this plan - Automated Javascript Unit Testing.

Get Some Background

In this post, I'm not planning to go deep into how to write unit tests, mock, spy, or any of that. This is going to be about where and how the tests are run, not how to write them. If you're just getting started with testing your RequireJS modules, check out [amd-testing][1] and [RequireJS + Chai + Moc

For the scenario, imagine posts has a foreign key user_id referencing users.id

public function up()
{
	Schema::create('posts', function(Blueprint $table) {
		$table->increments('id');
		$table->string('title');
		$table->text('body');
@orourkek
orourkek / iterm2.zsh
Last active August 29, 2015 14:06 — forked from wadey/iterm2.zsh
# Usage:
# source iterm2.zsh
# iTerm2 window/tab color commands
# Requires iTerm2 >= Build 1.0.0.20110804
# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
echo -ne "\033]6;1;bg;blue;brightness;$3\a"
@orourkek
orourkek / Class.php
Last active December 11, 2015 20:58 — forked from chrisamoore/Class.php
<?php
class Order
{
public $id;
function __construct($id)
{
$this->mediator = new Mediator();
}