Closed jamanda2000 closed 1 year ago
It may be the type of file. Tried a different file and get the following error:
ngentest d:/work/projects/bondi/sonata/workflow/workflow-web/src/app/workflow/workspace/workspace.model.ts
TypeError: Cannot read property 'toLowerCase' of undefined
at new InjectableTestGen (C:\Users\ajackson\AppData\Roaming\npm\node_modules\ngentest\src\injectable\injectable-test-gen.js:21:65)
at getTestGenerator (C:\Users\ajackson\AppData\Roaming\npm\node_modules\ngentest\index.js:90:33)
at run (C:\Users\ajackson\AppData\Roaming\npm\node_modules\ngentest\index.js:127:27)
at Object.
Thanks for trying it.
Hi, Thanks for replying.
I've found some files that seem to want to work, and I've tried with absolute path. Now getting this error:
ReferenceError: klassTemplate is not defined
at Object.
I've tried updated the config file, but don't think I'm doing it right. // when convert to JS, some codes need to be replaced to work replacements: [ // some 3rd party module causes an error { from: 'require\("html-custom-element"\)', to: '{}'}, { from: 'require\("cjs"\)', to: '{}'}, { from: '^\S+\.define\(.*\);', to: ''} // some commands causes error ],
It seems your NodeJs running environment is not usual or your config file has an invalid template location.
klassTemplate is located under node_modules/ngentest/...
and it is only overridable by your config file
Thanks for the info. I'll do some investigating to see if I can resolve this. Will let you know how it goes, though it may be a week before I can look at this again (client release pressure at the moment so I have to stop playing with getting our unit tests expanded)
Okay, it's getting there. Running them from the ngentest folder has helped, and also doing a full pat to the config file. Now we're just missing all the types. Have tried created a types.d.ts file but it's not working.
This is the error when running from within the node_modules/ngentest folder
/d/Work/Projects/Trunk/sonata/workflow/workflow-web (issue/master/newAngula rBranch) $ ngentest d:/work/projects/bondi/sonata/workflow/workflow-web/src/app/work flow/workspace/workspace.service.ts -c D:/work/projects/trunk/sonata/workfl ow/workflow-web/node_modules/ngentest/ngentest.config.js Error: Cannot find module '@shared' Require stack:
If I look in the index.js file, none of the declaration files for modules are being found - so tried forcing that with types.d.ts file but no luck.
PS: Sorry to be such a pain with this. I'm a java dev and very new to angular (learning it on the fly) so there's probably some things that I need to do that are obvious to others but I don't know about yet.
Closing by inactivity.
Hi,
I've installed gentest and created ngentest.config.js file.
Have tried running ngentest task-form.components.js in the file folder using the terminal in Visual Studio, using gitbash, using ./task-form.components.js, using the full path, using -c ngentest.config.js at the end of the command. Seems whatever I try I get an error
Any ideas of what to try next please?
Thanks, Amanda