mariocasciaro / scatter

IoC container and out-of-the-box extensibility for Node.js applications
MIT License
154 stars 14 forks source link

tests fail under Windows 7 #14

Closed k7sleeper closed 10 years ago

k7sleeper commented 10 years ago

After running the test suite by manually typing

> node .\node_modules\istanbul\lib\cli.js cover .\node_modules\mocha\bin\_mocha test\*.js --report html -- -R spec

on the console I get the following errors:

1) Scatter basic loading scoped assemble should load only matching modules in advance:
   AssertionError: expected { Object (namespace\Module1) } to have key 'namespace/Module1'

2) Scatter basic loading scoped assemble should load only matching modules in advance (with caching):
   AssertionError: expected {} to have key 'namespace/Module1'

3) Scatter basic loading scoped assemble should load assemble all (with caching):
   AssertionError: expected { Object (Module1, Module2, ...) } to have keys 'namespace/Module1', 'Module1', and 'Module2'

4) Scatter basic loading npm dir loading should discover roots under symlinked dirs:
   Error: EPERM, operation not permitted 'D:\dev\GitHub\repositories\scatter\test\01-load\nodeModulesLink\base2'
    at Object.fs.symlinkSync (fs.js:730:18)
    at Context.<anonymous> (D:\dev\GitHub\repositories\scatter\test\01-load.js:351:10)
    at Test.Runnable.run (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runnable.js:194:15)
    at Runner.runTest (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:372:10)
    at D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:448:12
    at next (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:297:14)
    at D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:307:7
    at next (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:245:23)
    at Object._onImmediate (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:274:5)
    at processImmediate [as _immediateCallback] (timers.js:330:15)
mariocasciaro commented 10 years ago

Unfortunately I admit Scatter was not really tested on Windows, and I already can think of a few point where it would break, mainly due to the directory separator and symlinks. I'm actually surprised to see only 4 tests failing.

Have you already spotted any clear cause? I'll take a look at the code later, and try to figure out where is the problem.

On Thu, Dec 12, 2013 at 8:43 AM, Klaus Sevensleeper < notifications@github.com> wrote:

After running the test suite by manually typing

node .\node_modules\istanbul\lib\cli.js cover .\node_modules\mocha\bin_mocha test*.js --report html -- -R spec

on the console I get the following errors:

1) Scatter basic loading scoped assemble should load only matching modules in advance: AssertionError: expected { Object (namespace\Module1) } to have key 'namespace/Module1'

2) Scatter basic loading scoped assemble should load only matching modules in advance (with caching): AssertionError: expected {} to have key 'namespace/Module1'

3) Scatter basic loading scoped assemble should load assemble all (with caching): AssertionError: expected { Object (Module1, Module2, ...) } to have keys 'namespace/Module1', 'Module1', and 'Module2'

4) Scatter basic loading npm dir loading should discover roots under symlinked dirs: Error: EPERM, operation not permitted 'D:\dev\GitHub\repositories\scatter\test\01-load\nodeModulesLink\base2' at Object.fs.symlinkSync (fs.js:730:18) at Context. (D:\dev\GitHub\repositories\scatter\test\01-load.js:351:10) at Test.Runnable.run (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runnable.js:194:15) at Runner.runTest (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:372:10) at D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:448:12 at next (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:297:14) at D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:307:7 at next (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:245:23) at Object._onImmediate (D:\dev\GitHub\repositories\scatter\node_modules\mocha\lib\runner.js:274:5) at processImmediate as _immediateCallback

— Reply to this email directly or view it on GitHubhttps://github.com/mariocasciaro/scatter/issues/14 .

k7sleeper commented 10 years ago

When I've time to dig into code, I'll tell you.

mariocasciaro commented 10 years ago

Fixed in 356baf486eac1b3ed5159cd104f2a9e6cf6fbabe