jscad / openscad-openjscad-translator

DEPRECATED: Convert OpenSCAD to JSCAD (See the link below)
https://github.com/jscad/OpenJSCAD.org/tree/V2/packages
MIT License
22 stars 10 forks source link

Error: Cannot find module 'test' #2

Closed techkey closed 2 years ago

techkey commented 9 years ago

Hi, whenever I try to run a test with node a error is thrown: Error: Cannot find module 'test'

A complete output is like this:

c:\teki\_downloads\GitHub\openscad-openjscad-translator-master\tests>node 2d_primitives.js        

module.js:340                                                                                     
    throw err;                                                                                    
          ^                                                                                       
Error: Cannot find module 'test'                                                                  
    at Function.Module._resolveFilename (module.js:338:15)                                        
    at Function.Module._load (module.js:280:25)                                                   
    at Module.require (module.js:364:17)                                                          
    at require (module.js:380:17)                                                                 
    at c:\teki\_downloads\GitHub\openscad-openjscad-translator-master\tests\2d_primitives.js:31:30
    at Object.context.execCb (c:\teki\node\node_modules\requirejs\bin\r.js:1898:33)               
    at Object.Module.check (c:\teki\node\node_modules\requirejs\bin\r.js:1114:51)                 
    at Object.Module.enable (c:\teki\node\node_modules\requirejs\bin\r.js:1391:22)                
    at Object.Module.init (c:\teki\node\node_modules\requirejs\bin\r.js:1022:26)                  
    at null._onTimeout (c:\teki\node\node_modules\requirejs\bin\r.js:1664:36)                     

Is there something missing from the tests directory or am I missing something else?

UPDATE: I found out that test is a node module. I've installed it and the error is gone, but when running node all-tests.js it always reports:

c:\teki\_downloads\GitHub\openscad-openjscad-translator-master\tests>node all-tests.js
Running all tests:                                                                    
  test1                                                                               
  test2                                                                               
  test5                                                                               
  test6                                                                               
  test7                                                                               
  test8                                                                               
  test9                                                                               
Passed:0 Failed:0 Errors:0                                                            

because the exports object in the file all-tests.js contains empty objects. Any ideas?

Individual tests are running fine it seems, it reports failed and passed tests.

Cornelis.

garyhodgson commented 9 years ago

Hi,

I can't say why the group tests doesn't work. I haven't touched this code in a long, long time, perhaps a dependency has changed somewhere.

Regards, Gary

techkey commented 9 years ago

Hi Gary,

Thanks a lot for your time and reply!

I've already solved it quickly by just writing a .bat file that runs the test files. That works for now.

Just to let you know, I've re-factored the whole code so that it passes jslint, reformatted all also, got rid of underscore and fixed some things along the way. All tests are OK and now I add some more tests, update the code according the latest OpenSCAD specification and add JSDOC3 docs on every function and object.

After the update I go testing with the V8 functions to see if all code can be pre-compiled etc.

I must say that your code has a good design, thank you very much for that!

Cornelis.

z3dev commented 2 years ago

This will not be fixed. Please reopen issues at OpenJSCAD.org