fullstackproltd / AspNetCoreSpa

Asp.Net 7.0 & Angular 15 SPA Fullstack application with plenty of examples. Live demo:
https://aspnetcorespa.fullstackpro.co.uk
MIT License
1.47k stars 464 forks source link

karma tests #4

Closed crh225 closed 8 years ago

crh225 commented 8 years ago

cannot get tests to run.

I used npm run test and get the following errors:

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\ nodemodules\npm\bin\npm-cli.js" "run" "tslint" "Client/*/.ts" npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! code ELIFECYCLE npm ERR! aspnetnetcore@0.0.0 tslint: `tslint "Client/**/.ts"` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the aspnetnetcore@0.0.0 tslint script 'tslint "Client/_/.ts "'. npm ERR! This is most likely a problem with the aspnetnetcore package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! tslint "Client/*/.ts" npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs aspnetnetcore npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls aspnetnetcore npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\housec\Downloads\AspNetCoreSpa-master (1)\AspNetCoreSpa-ma ster\npm-debug.log

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\ nodemodules\npm\bin\npm-cli.js" "run" "lint" npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! code ELIFECYCLE npm ERR! aspnetnetcore@0.0.0 lint: npm run tslint "Client/**/*.ts" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aspnetnetcore@0.0.0 lint script 'npm run tslint "Client/* /.ts"'. npm ERR! This is most likely a problem with the aspnetnetcore package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run tslint "Client/*/_.ts" npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs aspnetnetcore npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls aspnetnetcore npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\housec\Downloads\AspNetCoreSpa-master (1)\AspNetCoreSpa-ma ster\npm-debug.log

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\housec\AppData\ \Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "test" npm ERR! node v4.4.7 npm ERR! npm v3.10.5 npm ERR! code ELIFECYCLE npm ERR! aspnetnetcore@0.0.0 pretest: npm run lint npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aspnetnetcore@0.0.0 pretest script 'npm run lint'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the aspnetnetcore package , npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run lint npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs aspnetnetcore npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls aspnetnetcore npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\housec\Downloads\AspNetCoreSpa-master (1)\AspNetCoreSpa-ma ster\npm-debug.log

asadsahi commented 8 years ago

Thanks for letting me know.

According to angular.io docs, testing guidelines aren't final yet, so I will hang on, before making changes as per RC5 in this project.

crh225 commented 8 years ago

Demo is down again. http://aspnetcorespa.azurewebsites.net/

Is there anything I can help work on?

asadsahi commented 8 years ago

Hi @crh225 , thanks for the offer. Sure, there is always something which can be improved. :)

Few things pending are:

1) Client unit tests 2) Production build with webpack is broken since RC5 upgrade. Probably new angular compiler needs to bring in the mix. Not sure though, so this is something can be picked up as well. 3) Server side unit tests.

Any other good idea? I am happy to accept any pull requests.

crh225 commented 8 years ago

@asadsahi, I don't know if there's any other way of asking my questions than through comments on issues, but what do the plus signs mean in the components? Is this something new in rc5, or just a convention you use?

crh225 commented 8 years ago

Accoring to http://stackoverflow.com/questions/38895087/tests-are-failing-after-angular-2-rc5, angular removed references to jasmine in @angular/core/testing

Need to install typings for jasmin globally: typings install jasmin --source dt --global

all spec files need to be changed apparently. beforeEachProviders becomes beforeEach, and we need to remove the unnecessary imports.

When I got kamra working, four of the tests were failing, but I fixed those.

I have fixed all the tests and am creating a pull request

crh225 commented 8 years ago

Issue is fixed in pull request: #5

asadsahi commented 8 years ago

@crh225 thanks for helping. I have merge the pull request.

plus signs are conventions to prefix folder with modules which will be lazily loaded as explained in angular 2 guidelines here.