cliftonc / calipso

Calipso is a simple NodeJS content management system based on Express, Connect & Mongoose.
calip.so
1.71k stars 307 forks source link

Tests for all core libraries, plus basic sanity test. #6

Open cliftonc opened 13 years ago

cliftonc commented 13 years ago

Create tests for all core libraries, need to create second issue to create a web based module to run the tests - especially enabling test execution for modules.

cliftonc commented 13 years ago

Sanity test written, can be run to make sure that a change doesn't break anything fundamental, but is an outside in test only.

cliftonc commented 13 years ago

Tests for Menu written.

shuhblam commented 12 years ago

do you have any ideas on which test framework you would like to see implemented?

cliftonc commented 12 years ago

Mocha? It looks quite good.

LarryEitel commented 12 years ago

Trying to run 'sanity test' using mocha per reference in package.js:

NODE_ENV=mocha mocha --reporter spec -t 5000 -s 500

It returns:

calipso.logging.configureLogging(loggingConfig);
                ^
TypeError: Object #<Object> has no method 'configureLogging'
richtera commented 12 years ago

You should use "npm test" Andy

Sent via the internets

On Aug 23, 2012, at 12:15 PM, Larry Eitel notifications@github.com wrote:

Trying to run 'sanity test' using mocha per reference in package.js:

NODE_ENV=mocha mocha --reporter spec -t 5000 -s 500

It returns:

calipso.logging.configureLogging(loggingConfig); ^ TypeError: Object # has no method 'configureLogging'

— Reply to this email directly or view it on GitHubhttps://github.com/cliftonc/calipso/issues/6#issuecomment-7980646.

LarryEitel commented 12 years ago

got same response :S I'm on ubuntu server (latest)

richtera commented 12 years ago

Try to reinstall. But I'll look at it when I come back from vacation. Travisci is building it and running npm test and it passed. I'll check though Andy

Sent from my iPhone

On Aug 23, 2012, at 12:19 PM, Larry Eitel notifications@github.com wrote:

got same response :S

— Reply to this email directly or view it on GitHubhttps://github.com/cliftonc/calipso/issues/6#issuecomment-7980790.

LarryEitel commented 12 years ago

Thanks for reply. I reinstalled from repo with no complaints. App launches fine too. However, I get same error with trying to run tests using: npm test.

Enjoy your vacation. :)

LarryEitel commented 12 years ago

FYI, test is complaining about missing should. Adding it however, doesn't resolve this issue.

richtera commented 12 years ago

This doesn't make much sense are you testing inside of a deployed website or the root repo. The tests are designed to run. Git clone, npm install, npm test. If you deploy a site it won't find te right stuff I am guessing. Andy

Sent from my iPhone

On Aug 23, 2012, at 12:49 PM, Larry Eitel notifications@github.com wrote:

FYI, test is complaining about missing should. Adding it however, doesn't resolve this issue.

— Reply to this email directly or view it on GitHubhttps://github.com/cliftonc/calipso/issues/6#issuecomment-7981792.

LarryEitel commented 12 years ago

Here is a link to pastebin of test run on cloned repo of tower: http://pastebin.com/pwXvAsRQ

My related problem was in fact cause I was running a test on a new site. I WOULD like to see a test of generated new site, albeit simple. I and likely others would then extend from there. Actually, the core models could/should be testable. Also would serve as example for new custom models.

A Thanks to all who have contributed to this project!

richtera commented 12 years ago

You need to install the dev dependencies first. So run "npm install -dev" Then "npm test" The npm install -dev will install should and mocha. This works for me, please let me know if I have a hidden dependency on my system which makes is pass even though it shouldn't. Thanks Andy

On Aug 23, 2012, at 7:57 PM, Larry Eitel notifications@github.com wrote:

Here is a link to pastebin of test run on cloned repo of tower: http://pastebin.com/pwXvAsRQ

My related problem was in fact cause I was running a test on a new site. I WOULD like to see a test of generated new site, albeit simple. I and likely others would then extend from there. Actually, the core models could/should be testable. Also would serve as example for new custom models.

A Thanks to all who have contributed to this project!

— Reply to this email directly or view it on GitHub.

LarryEitel commented 12 years ago

git clone https://github.com/cliftonc/calipso.git cd calipso/ sudo npm install -d npm test

returns:

> calipso@0.3.4 test /home/larry/_of/_prjs/calipso
> NODE_ENV=mocha mocha --reporter spec -t 5000 -s 500

/home/larry/_of/_prjs/calipso/test/helpers/calipsoHelper.js:98
calipso.logging.configureLogging(loggingConfig);
                ^
TypeError: Object #<Object> has no method 'configureLogging'
    at Object.<anonymous> (/home/larry/_of/_prjs/calipso/test/helpers/calipsoHelper.js:98:17)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/home/larry/_of/_prjs/calipso/test/lib.core.menu.js:7:21)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Mocha.loadFiles (/home/larry/_of/_prjs/calipso/node_modules/mocha/lib/mocha.js:126:27)
    at Array.forEach (native)
    at Mocha.loadFiles (/home/larry/_of/_prjs/calipso/node_modules/mocha/lib/mocha.js:123:14)
    at Mocha.run (/home/larry/_of/_prjs/calipso/node_modules/mocha/lib/mocha.js:229:8)
    at Object.<anonymous> (/home/larry/_of/_prjs/calipso/node_modules/mocha/bin/_mocha:324:7)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0
richtera commented 12 years ago

What version of node? I can't reproduce this problem. I am using npm@1.1.45 node@0.8.4 Running on MacOS. The last builds on devel and master passed as per travisci http://travis-ci.org/#!/cliftonc/calipso/builds The devel and master branch were merged. Thanks Andy

On Aug 24, 2012, at 7:29 AM, Larry Eitel notifications@github.com wrote:

git clone https://github.com/cliftonc/calipso.git cd calipso/ sudo npm install -d npm test

returns:

calipso@0.3.4 test /home/larry/_of/_prjs/calipso NODE_ENV=mocha mocha --reporter spec -t 5000 -s 500

/home/larry/_of/_prjs/calipso/test/helpers/calipsoHelper.js:98 calipso.logging.configureLogging(loggingConfig); ^ TypeError: Object # has no method 'configureLogging' at Object. (/home/larry/_of/_prjs/calipso/test/helpers/calipsoHelper.js:98:17) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17) at require (module.js:378:17) at Object. (/home/larry/_of/_prjs/calipso/test/lib.core.menu.js:7:21) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17) at require (module.js:378:17) at Mocha.loadFiles (/home/larry/_of/_prjs/calipso/node_modules/mocha/lib/mocha.js:126:27) at Array.forEach (native) at Mocha.loadFiles (/home/larry/_of/_prjs/calipso/node_modules/mocha/lib/mocha.js:123:14) at Mocha.run (/home/larry/_of/_prjs/calipso/node_modules/mocha/lib/mocha.js:229:8) at Object. (/home/larry/_of/_prjs/calipso/node_modules/mocha/bin/_mocha:324:7) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.runMain (module.js:492:10) at process.startup.processNextTick.process._tickCallback (node.js:244:9) npm ERR! Test failed. See above for more details. npm ERR! not ok code 0 — Reply to this email directly or view it on GitHub.

LarryEitel commented 12 years ago

Distributor ID: Ubuntu Description: Ubuntu 12.04 LTS Release: 12.04 npm: 1.1.48 node: 0.8.6

richtera commented 12 years ago

Travis has 0.8.7 and it's failing now. 0.8.3 worked fine. Must be a node version thing. I am still on vacation but had an hour to check. I will probably need some time to fix but I am installing 0.8.7 locally to see for now. Thanks Andy

On Aug 24, 2012, at 10:22 AM, Larry Eitel notifications@github.com wrote:

Distributor ID: Ubuntu Description: Ubuntu 12.04 LTS Release: 12.04 npm: 1.1.48 node: 0.8.6

— Reply to this email directly or view it on GitHub.

richtera commented 12 years ago

bcrypt is no longer compatible with 0.8 latest due to uv.h. We'll have to talk to the bcrypt guys. Thanks Andy

On Aug 24, 2012, at 10:22 AM, Larry Eitel notifications@github.com wrote:

Distributor ID: Ubuntu Description: Ubuntu 12.04 LTS Release: 12.04 npm: 1.1.48 node: 0.8.6

— Reply to this email directly or view it on GitHub.

richtera commented 12 years ago

Looks like it might have been a node 0.8.6 or 0.8.7 problem and nvm. I had to upgrade my nvm version and then use 0.8.8 and now it's succeeding. I will still need to double check that a new site built with the calipso command line can be tested. I'll do that when I get back from vacation. Thanks Andy

On Aug 24, 2012, at 10:22 AM, Larry Eitel notifications@github.com wrote:

Distributor ID: Ubuntu Description: Ubuntu 12.04 LTS Release: 12.04 npm: 1.1.48 node: 0.8.6

— Reply to this email directly or view it on GitHub.

richtera commented 12 years ago

To test a deployed site:

npm install -g calipso calipso site cd

This is required in order to install dev dependencies:

npm install npm test

This should pass. Please let me know. Thanks Andy

On Aug 24, 2012, at 1:22 PM, Larry Eitel notifications@github.com wrote:

Distributor ID: Ubuntu Description: Ubuntu 12.04 LTS Release: 12.04 npm: 1.1.48 node: 0.8.6

— Reply to this email directly or view it on GitHub.