Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in library - Not able to run unit test in angular 2 seed project #11

Closed
kapoorruchi opened this issue Nov 16, 2016 · 4 comments
Closed

Comments

@kapoorruchi
Copy link

kapoorruchi commented Nov 16, 2016

I'm using ng2-validators for template driven forms validation.
While running unit tests, I am getting below error with ng2-validators :


16 11 2016 17:43:14.668:INFO [Chrome 54.0.2840 (Windows 7 0.0.0)]: Connected on socket NoNtdnDZeME4gr-sAAAA with id 30858027
16 11 2016 17:43:15.493:WARN [web-server]: 404: /node_modules/ng2-validators/package.json
Chrome 54.0.2840 (Windows 7 0.0.0) ERROR: '(SystemJS) XHR error (404 Not Found) loading http://localhost:9876/node_modules/ng2-validators/package.json
        Error: XHR error (404 Not Found) loading http://localhost:9876/node_modules/ng2-validators/package.json
            at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:9876/base/node_modules/zone.js/dist/zone.js?c35727d0e64913b5669320b167e496fc94fc6928:647:29)
            at ZoneDelegate.invokeTask (http://localhost:9876/base/node_modules/zone.js/dist/zone.js?c35727d0e64913b5669320b167e496fc94fc6928:236:37)
            at Zone.runTask (http://localhost:9876/base/node_modules/zone.js/dist/zone.js?c35727d0e64913b5669320b167e496fc94fc6928:136:47)
            at XMLHttpRequest.ZoneTask.invoke (http://localhost:9876/base/node_modules/zone.js/dist/zone.js?c35727d0e64913b5669320b167e496fc94fc6928:304:33)
        Error loading http://localhost:9876/node_modules/ng2-validators/package.json
        Error loading http://localhost:9876/base/dist/dev/app/user-management/user-management.module.js as "./user-management.module" from http://localhost:9876/base/dist/dev/app/user-management/create-user.component.spec.js'

Finished in 0.001 secs / 0 secs

SUMMARY:
√ 0 tests completed
npm ERR! Test failed. See above for more details.

Please help , this is quite urgent.
Link for angular 2 seed

@Nightapes
Copy link
Owner

Hello,
which Version are you using?
I added ng2-validators to the seed project and the tests working without problems.
Can you show me your karma.conf.js and project.config.ts file?

@kapoorruchi
Copy link
Author

kapoorruchi commented Nov 25, 2016

Hello,
Apologies for late response. We were moved to other priority tasks.
Please find my karma.conf.js and project.config.ts.
Version : "ng2-validators": "^1.5.2",
Please help on priority.

karma_project_config_files.zip

@Nightapes
Copy link
Owner

Hello,

can you replace line 95 :

{ pattern: 'node_modules/ng2-validators/*.js', included: false, watched: false }, 

in the karma.conf.js with

Version < 1.6.0
 { pattern: 'node_modules/ng2-validators/**/*.js', included: false, watched: false },

Version > 1.6.0
 { pattern: 'node_modules/ng2-validators/**/*.js', included: false, watched: false },
 { pattern: 'node_modules/google-libphonenumber/dist/libphonenumber.js', included: false, watched: false },

@kapoorruchi
Copy link
Author

Thanks..
Working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants