-
Notifications
You must be signed in to change notification settings - Fork 1.2k
gulp test:client returns Error: 1 at formatError #1748
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
Comments
Getting the same error with similar setups.
Operating System: Ubuntu 15.10
Using Answer 2 but with ui-router and Grunt does however work for me. Should probably also be mentioned that I for answer 1 & 2 manually added the same typings folders used in the grunt version before either configuration would work. Additionally removed
from Answer 3 came to this state after running |
I'm looking into this. Adding this option to karma helps: |
First issue: |
@Awk34: Using the configuration labeled as "Answer 3" above and using the change you mentioned, the tests did now show up but they all fail because of some issue with transpilation I think. The errors I'm getting now: Component: mainComponent
✗ should attach a list of things to the controller
/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4588:53
forEach@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:322:24
loadModules@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4548:12
createInjector@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4470:30
workFn@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular-mocks/angular-mocks.js:2954:60
TypeError: undefined is not an object (evaluating 'mainComponent.$onInit') in /home/adam/apps/karma-fullstack-gulp/.tmp/test/app/main/main.controller.spec.js (line 25)
/home/adam/apps/karma-fullstack-gulp/.tmp/test/app/main/main.controller.spec.js:25:22
Controller: OauthButtonsCtrl
✗ should attach loginOauth
/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4588:53
forEach@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:322:24
loadModules@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4548:12
createInjector@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4470:30
workFn@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular-mocks/angular-mocks.js:2954:60
TypeError: undefined is not an object (evaluating 'OauthButtonsCtrl.loginOauth') in /home/adam/apps/karma-fullstack-gulp/.tmp/test/components/oauth-buttons/oauth-buttons.controller.spec.js (line 16)
/home/adam/apps/karma-fullstack-gulp/.tmp/test/components/oauth-buttons/oauth-buttons.controller.spec.js:16:32
Directive: oauthButtons
✗ should contain anchor buttons
/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4588:53
forEach@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:322:24
loadModules@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4548:12
createInjector@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4470:30
workFn@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular-mocks/angular-mocks.js:2954:60
/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4588:53
forEach@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:322:24
loadModules@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4548:12
createInjector@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4470:30
workFn@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular-mocks/angular-mocks.js:2954:60
inject@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular-mocks/angular-mocks.js:2934:46
compileDirective@/home/adam/apps/karma-fullstack-gulp/.tmp/test/components/oauth-buttons/oauth-buttons.directive.spec.js:8:15
/home/adam/apps/karma-fullstack-gulp/.tmp/test/components/oauth-buttons/oauth-buttons.directive.spec.js:19:25
✗ should evaluate and bind the classes attribute to scope.classes
/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4588:53
forEach@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:322:24
loadModules@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4548:12
createInjector@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4470:30
workFn@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular-mocks/angular-mocks.js:2954:60
TypeError: Attempted to assign to readonly property. in /home/adam/apps/karma-fullstack-gulp/.tmp/test/components/oauth-buttons/oauth-buttons.directive.spec.js (line 23)
/home/adam/apps/karma-fullstack-gulp/.tmp/test/components/oauth-buttons/oauth-buttons.directive.spec.js:23:20
✗ should bind scope.classes to class names on the anchor buttons
/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4588:53
forEach@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:322:24
loadModules@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4548:12
createInjector@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4470:30
workFn@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular-mocks/angular-mocks.js:2954:60
/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4588:53
forEach@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:322:24
loadModules@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4548:12
createInjector@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular/angular.js:4470:30
workFn@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular-mocks/angular-mocks.js:2954:60
inject@/home/adam/apps/karma-fullstack-gulp/client/bower_components/angular-mocks/angular-mocks.js:2934:46
compileDirective@/home/adam/apps/karma-fullstack-gulp/.tmp/test/components/oauth-buttons/oauth-buttons.directive.spec.js:8:15
/home/adam/apps/karma-fullstack-gulp/.tmp/test/components/oauth-buttons/oauth-buttons.directive.spec.js:28:25
PhantomJS 2.1.1 (Linux 0.0.0): Executed 5 of 5 (5 FAILED) ERROR (0.046 secs / 0.036 secs)
[20:12:47] 'test:client' errored after 645 ms
[20:12:47] Error: 1
at formatError (/home/adam/.nvm/versions/node/v4.4.2/lib/node_modules/gulp-cli/lib/versioned/^3.7.0/formatError.js:20:10)
at Gulp.<anonymous> (/home/adam/.nvm/versions/node/v4.4.2/lib/node_modules/gulp-cli/lib/versioned/^3.7.0/log/events.js:41:15)
at emitOne (events.js:77:13)
at Gulp.emit (events.js:169:7)
at Gulp.Orchestrator._emitTaskDone (/home/adam/apps/karma-fullstack-gulp/node_modules/orchestrator/index.js:264:8)
at /home/adam/apps/karma-fullstack-gulp/node_modules/orchestrator/index.js:275:23
at finish (/home/adam/apps/karma-fullstack-gulp/node_modules/orchestrator/lib/runTask.js:21:8)
at cb (/home/adam/apps/karma-fullstack-gulp/node_modules/orchestrator/lib/runTask.js:29:3)
at removeAllListeners (/home/adam/apps/karma-fullstack-gulp/node_modules/karma/lib/server.js:336:7)
at Server.<anonymous> (/home/adam/apps/karma-fullstack-gulp/node_modules/karma/lib/server.js:347:9)
at Server.g (events.js:260:16)
at emitNone (events.js:72:20)
at Server.emit (events.js:166:7)
at emitCloseNT (net.js:1521:8)
at nextTickCallbackWith1Arg (node.js:431:9)
at process._tickDomainCallback (node.js:394:17) Looking into the Will try with the aforementioned karma option as well. |
@Koslun This is what mine contains with your 'Options 1' |
@Awk34 Yours does make a lot more sense, can't really find why my version doesn't look like it yet. Mine is like your |
Looking at it again it's obvious that the test files are present with the Deleting the .tmp folder I additionally found the old regular files gone. The new errors I got were: Error: [$injector:modulerr] Failed to instantiate module karmaFullstackGulpOneApp due to:
Error: [$injector:modulerr] Failed to instantiate module karmaFullstackGulpOneApp.auth due to:
Error: [$injector:modulerr] Failed to instantiate module karmaFullstackGulpOneApp.constants due to:
Error: [$injector:nomod] Module 'karmaFullstackGulpOneApp.constants' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. Solved by including Where there is a difference between the gulp and grunt version, where the gulp version has this |
Fix a bug in gulp + typescript builds causing the test files to not be found by karma. Relates to issue angular-fullstack#1748
I just created a new project with the specified options. When i run "gulp test:client" I get the following error:
PhantomJS 2.1.1 (Windows 8 0.0.0): Executed 0 of 0 ERROR (0.001 secs / 0 secs)
[11:06:15] 'test:client' errored after 3.09 s
[11:06:15] Error: 1
at formatError (C:\Users\chris\Desktop\DemoMEAN\node_modules\gulp\bin\gulp.js:169:10)
at Gulp. (C:\Users\chris\Desktop\DemoMEAN\node_modules\gulp\bin\gulp.js:195:15)
The text was updated successfully, but these errors were encountered: