Skip to content

Instantly share code, notes, and snippets.

@javierfdezg
Created May 29, 2015 01:35
Show Gist options
  • Save javierfdezg/ee57103c9b461b18b9d8 to your computer and use it in GitHub Desktop.
Save javierfdezg/ee57103c9b461b18b9d8 to your computer and use it in GitHub Desktop.
Node test
module.exports = function () {
return {
_state : {
views : 'views'
},
set : function(key, val) { this._state[key] = val; }
};
};
var expect = require('chai').expect;
describe('State', function() {
var microbe = require('./microbe.js'), app;
beforeEach(function(done) {
app = microbe();
done();
});
it('should update the view location with app.set', function() {
app.set('views', 'test');
expect(app._state.views).to.equal('test');
});
it('should return "views" as the defualt view location', function() {
expect(app._state.views).to.equal('views');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment