mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 18:52:50 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
46
node_modules/kareem/test/post.test.js
generated
vendored
Normal file
46
node_modules/kareem/test/post.test.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
var assert = require('assert');
|
||||
var Kareem = require('../');
|
||||
|
||||
describe('execPost', function() {
|
||||
var hooks;
|
||||
|
||||
beforeEach(function() {
|
||||
hooks = new Kareem();
|
||||
});
|
||||
|
||||
it('handles errors', function(done) {
|
||||
hooks.post('cook', function(eggs, callback) {
|
||||
callback('error!');
|
||||
});
|
||||
|
||||
hooks.execPost('cook', null, [4], function(error, eggs) {
|
||||
assert.equal('error!', error);
|
||||
assert.ok(!eggs);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('multiple posts', function(done) {
|
||||
hooks.post('cook', function(eggs, callback) {
|
||||
setTimeout(
|
||||
function() {
|
||||
callback();
|
||||
},
|
||||
5);
|
||||
});
|
||||
|
||||
hooks.post('cook', function(eggs, callback) {
|
||||
setTimeout(
|
||||
function() {
|
||||
callback();
|
||||
},
|
||||
5);
|
||||
});
|
||||
|
||||
hooks.execPost('cook', null, [4], function(error, eggs) {
|
||||
assert.ifError(error);
|
||||
assert.equal(4, eggs);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user