allenhwkim / ngentest

Angular6+ Unit Test Generator For Components, Directive, Services, and Pipes
https://ngentest.github.io
MIT License
144 stars 60 forks source link

Hi i am getting following typeError while running the command ngentest. #26

Closed subrat7 closed 4 years ago

subrat7 commented 4 years ago

const tsFile = argv._[0].replace(/.spec.ts$/, '.ts'); ^

TypeError: Cannot read property 'replace' of undefined at Object. (C:\Users\20122701\AppData\Roaming\npm\node_modules\ngentest\index.js:43:26) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)

Please help me, Thanks in advance.

allenhwkim commented 4 years ago

You need to provide your component file name as an agrument e.g., $ ngentest ./app.component.ts

Please provide your full command outputs. I may need to do some for windows. This has been tested with Mac.

subrat7 commented 4 years ago

thanks It worked for me :)