Skip to content

Instantly share code, notes, and snippets.

@fidothe
Last active December 15, 2015 20:19
Show Gist options
  • Save fidothe/5317871 to your computer and use it in GitHub Desktop.
Save fidothe/5317871 to your computer and use it in GitHub Desktop.
{
"name": "next_timeline",
"version": "0.1.0",
"description": "Just the test infrastructure, ma'am",
"devDependencies": {
"buster": "~0.6.12",
"requirejs": "~2.1.2"
},
"dependencies": {},
"scripts": {
"test": "buster test"
},
"author": "Matt Patterson <[email protected]>"
}
config = module.exports;
config["My tests"] = {
environment: "node",
tests: [
"**/*_spec.js"
]
};
var buster = require("buster");
var requirejs = require('requirejs');
requirejs.config({ nodeRequire: require, baseUrl: __dirname + '/../public/scripts' });
buster.spec.expose();
var Graph = requirejs('graph');
describe('Graph', function() {
before(function() {
this.store = new Graph();
this.item = {id: function() { return "abcde"; }};
this.other_item = {id: function() { return "12345"; }};
});
it('can add an object with an ID to the store', function() {
this.store.add(this.item);
expect(this.store.get("abcde")).toEqual(this.item);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment