vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

how do you run the tests locally? #405

Closed lalitkapoor closed 8 years ago

lalitkapoor commented 8 years ago

I'd like to open a pull request for something, but I can't figure out how to run the tests. Can you please advise @vitalets. Thank you.

eugef commented 8 years ago

@mitcht, could you take a look?

vitalets commented 8 years ago

opening test/e2e/dev-test.html in browser is not work?

mitcht commented 8 years ago

I had to host it on an actual server before it would run...

vitalets commented 8 years ago

ok, it seems not to be a problem. I my current projects I use this:

npm i http-server -g
http-server test/e2e

it starts start static web server in specified directory.

lalitkapoor commented 8 years ago

@mitcht @vitalets I tried that in the past. All i get is errors as it tries to fetch the following (all 404s):

dev-test.html:6 GET http://localhost:9090/libs/angular/1.2.7/angular-scenario.js 
dev-test.html:12 GET http://localhost:9090/docs/demos/text-simple/test.js 
dev-test.html:13 GET http://localhost:9090/docs/demos/text-customize/test.js 
dev-test.html:14 GET http://localhost:9090/docs/demos/text-btn/test.js 
dev-test.html:15 GET http://localhost:9090/docs/demos/select-local/test.js 
dev-test.html:16 GET http://localhost:9090/docs/demos/select-remote/test.js 
dev-test.html:17 GET http://localhost:9090/docs/demos/select-multiple/test.js 
dev-test.html:18 GET http://localhost:9090/docs/demos/select-nobuttons/test.js 
dev-test.html:19 GET http://localhost:9090/docs/demos/html5-inputs/test.js 
dev-test.html:20 GET http://localhost:9090/docs/demos/textarea/test.js 
dev-test.html:21 GET http://localhost:9090/docs/demos/checkbox/test.js 
dev-test.html:22 GET http://localhost:9090/docs/demos/checklist/test.js 
dev-test.html:23 GET http://localhost:9090/docs/demos/radiolist/test.js 
dev-test.html:24 GET http://localhost:9090/docs/demos/bsdate/test.js 
dev-test.html:25 GET http://localhost:9090/docs/demos/bstime/test.js 
dev-test.html:26 GET http://localhost:9090/docs/demos/typeahead/test.js 
dev-test.html:27 GET http://localhost:9090/docs/demos/validate-local/test.js 
dev-test.html:28 GET http://localhost:9090/docs/demos/validate-remote/test.js 
dev-test.html:29 GET http://localhost:9090/docs/demos/onbeforesave/test.js 
dev-test.html:30 GET http://localhost:9090/docs/demos/onaftersave/test.js 
dev-test.html:31 GET http://localhost:9090/docs/demos/editable-form/test.js 
dev-test.html:32 GET http://localhost:9090/docs/demos/editable-row/test.js 
dev-test.html:33 GET http://localhost:9090/docs/demos/editable-column/test.js 
dev-test.html:34 GET http://localhost:9090/docs/demos/editable-table/test.js 
dev-test.html:37 GET http://localhost:9090/docs/demos/dev-text/test.js 
dev-test.html:38 GET http://localhost:9090/docs/demos/dev-form/test.js 
dev-test.html:39 GET http://localhost:9090/docs/demos/dev-select/test.js 404 (Not Found)
lalitkapoor commented 8 years ago

@mitcht @vitalets If I run the server in the root directory of the project and then navigate to tests/e2e/dev-test.html all I get are failures for the tests:

Error: [$injector:unpr] Unknown provider: editableIconsProvider <- editableIcons
http://errors.angularjs.org/1.2.7/$injector/unpr?p0=editableIconsProvider%20%3C-%20editableIcons
    at angular.js:78
    at angular.js:3540
    at Object.getService [as get] (angular.js:3667)
    at angular.js:3545
    at getService (angular.js:3667)
    at invoke (angular.js:3694)
    at Object.instantiate (angular.js:3715)
    at angular.js:6766
    at angular.js:6179
    at forEach (angular.js:309)
vitalets commented 8 years ago

@lalitkapoor I just re-checked: yes you should start server in root and then open in browser tests/e2e/doc-test.html - to test actual documentation examples work or tests/e2e/dev-test.html - to run tests during development

The second is really broken because of Unknown provider: editableIconsProvider <- editableIcons I think some commit has broken it. It would be great if you investigate and find error..

lalitkapoor commented 8 years ago

@vitalets do you mind trying to find the error? I'm not as familiar as you are with the code base. I'll try and help, but I feel like you should own this one because it means that master is not in a good state and things are not being properly tested before being merged.

We should add a CI maybe so that the chances of failing releases is reduced.

mitcht commented 8 years ago

The bower packages are out of date first of all. The newer versions don't quite work right. You might look down that road.

ckosloski commented 8 years ago

The tests have all been fixed in pull-request #443