I have a module as below in a js file
app.js
angular.module( 'app', [ 'ui.bootstrap', 'routes', 'module2', 'ngAnimate', 'ngSanitize' ] );
If i am to write a unit test case then how should i load the modules in my unit test case??
Is it this way
module('app');
Other way
module('ui.bootstrap');
module('routes');
module('module2');
module('ngAnimate');
module('ngSanitize');
Which is right order or the right way to load the module...As am always getting the below error
Error: [$injector:unpr] Unknown provider: deepakProvider <- deepak
http://errors.angularjs.org/1.4.9/$injector/unpr?p0=deepakProvider%20%3C-%20deepak
at C:/jasmine/InformedEnrollment2/src/webapp/informedenrollment2/webclnt/components/angular/angular.js:68:12
at C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4346:19
at Object.getService [as get] (C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4494:39)
at C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4351:45
at Object.getService [as get] (C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4494:39)
at Object.<anonymous> (C:/jasmine/project/tests/DemoToTheTeam.js:20:47)
at Object.invoke (C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4535:17)
at Object.workFn (C:/jasmine/project/node_modules/angular-mocks/angular-mocks.js:3071:20)
Error: Declaration Location
at window.inject.angular.mock.inject (C:/jasmine/project/node_modules/angular-mocks/angular-mocks.js:3033:25)
at Suite.<anonymous> (C:/jasmine/project/tests/DemoToTheTeam.js:19:15)
at C:/jasmine/project/tests/DemoToTheTeam.js:2:1
TypeError: Cannot read property 'multiply' of undefined
at Object.<anonymous> (C:/jasmine/project/tests/DemoToTheTeam.js:26:13)
50.0.2661 (Windows 7 0.0.0): Executed 7 of 7 (1 FAILED) (0.182 secs / 0.064 secs)
Related
Same code is run properly in localhost but on server its show error
An uncaught Exception was encountered
Type: Error
Message: Class 'Public_Controller' not found
Filename: /home/referralearn/public_html/techmaa.org/portal/application/controllers/Auth.php
Line Number: 4
Backtrace:
File: /home/referralearn/public_html/techmaa.org/portal/index.php
Line: 314
Function: require_once
help me to solve this
Currently learning serverless and state machines. When I'm trying to do deployment I'm getting error: TypeError: Cannot read property ‘startsWith’ of undefined.
Below you can find serverless.yml definition which I'm trying to deploy. I can't spot the error I did.
State machine I want is really basic and simple. I want to start it with decision, which will direct to correct lambda, depends on input (all of this manual, semi-manual for now). After lambda completion (no matter which one) will be end.
service: state-machine
plugins:
- serverless-python-requirements
- serverless-iam-roles-per-function
- serverless-step-functions
- serverless-pseudo-parameters
custom:
pythonRequirements:
dockerizePip: non-linux
slim: true
zip: true
provider:
name: aws
runtime: python3.8
region: eu-central-1
stage: ${opt:stage, 'testing'}
timeout: 30
iamRoleStatements:
- Effect: Allow
Action:
- lambda:InvokeFunction
- lambda:InvokeAsync
Resource: "*"
package:
individually: true
exclude:
- node_modules/**
- .git/**
- .venv/**
functions:
process-purchase:
module: state-machine
memorySize: 128
stages:
- testing
- dev
handler: ProcessPurchase.process_purchase
process-refund:
module: state-machine
memorySize: 128
stages:
- testing
- dev
handler: ProcessRefund.process_refund
stepFunctions:
validate: true
stateMachines:
TransactionChoiceMachine:
name: ChoiceMachineTest-${self:provider.stage}
dependsOn: CustomIamRole
definition:
Comment: "Purchase refund choice"
StartAt: ProcessTransaction
States:
ProcessTransaction:
Type: Choice
Choices:
- Variable: "$.TransactionType"
StringEquals: "PURCHASE"
Next: PurchaseState
- Variable: "$.TransactionType"
StringEquals: "REFUND"
Next: RefundState
PurchaseState:
Type: Task
Resource:
Fn::GetAtt: [process-purchase, Arn]
End: true
RefundState:
Type: Task
Resourse:
Fn::GetAtt: [process-refund, Arn]
End: true
This is the log I get after SLS_DEBUG=true:
Type Error ---------------------------------------------
TypeError: Cannot read property 'startsWith' of undefined
at /home/maciej/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:374:59
at arrayMap (/home/maciej/node_modules/lodash/lodash.js:639:23)
at map (/home/maciej/node_modules/lodash/lodash.js:9554:14)
at Function.flatMap (/home/maciej/node_modules/lodash/lodash.js:9257:26)
at ServerlessStepFunctions.getIamPermissions (/home/maciej/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:327:12)
at /home/maciej/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:423:56
at Array.forEach (<anonymous>)
at ServerlessStepFunctions.compileIamRole (/home/maciej/node_modules/serverless-step-functions/lib/deploy/stepFunctions/compileIamRole.js:412:32)
From previous event:
at PluginManager.invoke (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:498:22)
at PluginManager.spawn (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:518:17)
at /usr/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:122:50
From previous event:
at Object.before:deploy:deploy [as hook] (/usr/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:102:22)
at /usr/lib/node_modules/serverless/lib/classes/PluginManager.js:498:55
From previous event:
at PluginManager.invoke (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:498:22)
at /usr/lib/node_modules/serverless/lib/classes/PluginManager.js:533:24
From previous event:
at PluginManager.run (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:533:8)
at /usr/lib/node_modules/serverless/lib/Serverless.js:168:33
From previous event:
at Serverless.run (/usr/lib/node_modules/serverless/lib/Serverless.js:155:74)
at /usr/lib/node_modules/serverless/scripts/serverless.js:50:26
at processImmediate (internal/timers.js:461:21)
From previous event:
at Object.<anonymous> (/usr/lib/node_modules/serverless/scripts/serverless.js:50:4)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/lib/node_modules/serverless/bin/serverless.js:47:1)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
Line 77 in my serverless.yml has typo... should be Resource.
Compilation errors for PROCEDURE MTR.MTR_DAILY_MAIL_REPORT_PRC1
Error: PLS-00201: identifier 'EXCELFILE.EXCEL_OPEN' must be declared
Line: 54
Text: Excelfile.Excel_Open(Excel_Data);
Everything was working and i was capable to run gulp and gulp watch normally, after some changes in my phpspec files it dosn't work anymore. See the details below.
This is my gulpfile.js
var elixir = require('laravel-elixir');
elixir(function (mix) {
mix.phpUnit().phpSpec();
// this task should look for files inside the resources/assets/sass
// folder.
mix.sass(
[
'./resources/assets/bower/bootstrap-sass/assets/stylesheets/_bootstrap.scss',
'**',
],
'resources/assets/css/sass.css'
);
// this task should look for files inside the resources/assets/css
// folder.
mix.styles(
[
'**',
],
'public/css/all.css'
);
// this task should look for files inside the resources/assets/js
// folder.
mix.scripts(
[
'./resources/assets/bower/jquery/dist/jquery.js',
'./resources/assets/bower/bootstrap-sass/assets/javascripts/bootstrap.js',
'**',
],
'public/js/app.js'
);
mix.version(
[
"css/all.css",
"js/app.js",
]
);
mix.browserSync(
{
proxy: "localhost:8000",
}
);
});
And this is the output after runing gulp:
[19:00:44] Using gulpfile ~/Public/forsale/gulpfile.js
[19:00:44] Starting 'default'...
[19:00:44] Starting 'PHPUnit'...
Triggering PHPUnit: vendor/bin/phpunit --verbose
[19:00:44] Finished 'default' after 44 ms
PHPUnit 4.8.26 by Sebastian Bergmann and contributors.
Runtime: PHP 7.0.4-7ubuntu2.1
Configuration: /home/rafael/Public/forsale/phpunit.xml
.
Time: 49 ms, Memory: 8.00MB
OK (1 test, 1 assertion)
[19:00:44] gulp-notify: [Green!] Your PHPUnit tests passed!
[19:00:44] Finished 'PHPUnit' after 144 ms
[19:00:44] Starting 'PHPSpec'...
Triggering PHPSpec: vendor/bin/phpspec run
/ skipped: 0% / pending: 0% / passed: 100% / failed: 0% / broken: 0% / 2 examples
1 specs
2 examples (2 passed)
5ms
[19:00:44] gulp-notify: [Green!] Your PHPSpec tests passed!
[19:00:44] Finished 'PHPSpec' after 84 ms
[19:00:44] Starting 'sass'...
Fetching Sass Source Files...
- ./resources/assets/bower/bootstrap-sass/assets/stylesheets/_bootstrap.scss
Saving To...
- resources/assets/css/sass.css
[19:00:44] 'sass' errored after 104 ms
[19:00:44] Error: Cannot find module './flex-Spec'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/rafael/Public/forsale/node_modules/autoprefixer-core/lib/hacks/flex.js:6:14)
at Object.<anonymous> (/home/rafael/Public/forsale/node_modules/autoprefixer-core/lib/hacks/flex.js:58:4)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
[19:00:44] Error in plugin 'run-sequence(sass)'
Message:
sass catch
It seems that run-sequence has a missing module, but i didn't find it.
The problem was solved, i removed my node_modules folder and applied npm install && npm update again. It looks like one of my libraries were damaged and i don't know why.
My website Joomla 3.2 website was running well recently, when I got this error message and things don't work anymore.
Notice: Undefined offset: 0 in C:\Apache2\htdocs\ictogcio\libraries\cms\application\site.php on line 479
Notice: Trying to get property of non-object in C:\Apache2\htdocs\ictogcio\libraries\cms\application\site.php on line 483
Warning: Creating default object from empty value in C:\Apache2\htdocs\ictogcio\libraries\cms\application\site.php on line 483
Notice: Undefined offset: 0 in C:\Apache2\htdocs\ictogcio\libraries\cms\application\site.php on line 479
Notice: Trying to get property of non-object in C:\Apache2\htdocs\ictogcio\libraries\cms\application\site.php on line 483
Warning: Creating default object from empty value in C:\Apache2\htdocs\ictogcio\libraries\cms\application\site.php on line 483
Error displaying the error page: Could not find template "".