Geb Tests for pages with javascript in grails 2.3.5 - javascript

I am upgrading from grails 2.2.4 to grails 2.3.5 and the last problem I am having is with geb functional tests. I have upgraded geb to 0.9.2.
The first problem is that it seems like it is first trying to run the geb tests as spock tests even though there aren't any geb spock tests, before running as a regular geb test.
The second problem is that in both cases when javascript is enabled, i.e.
in GebConfig.groovy
driver = {
def driver = new HtmlUnitDriver()
driver.javascriptEnabled = true
return driver
}
I get the following exception :
| ======= EXCEPTION START ========
Exception class=[net.sourceforge.htmlunit.corejs.javascript.EvaluatorException]
com.gargoylesoftware.htmlunit.ScriptException: syntax error (http://localhost:8081/xyz/static/IKfETRJERwBRdVMGxGDGgTIvzB2B464w7472lQKpd3b.js#156)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:684)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:602)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:524)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadJavaScriptFromUrl(HtmlPage.java:1144)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1039)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:409)
at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:266)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:683)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:642)
at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170)
at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072)
at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330)
at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3116)
at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2083)
at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:918)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:899)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:242)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:188)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:437)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:311)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:393)
at com.gargoylesoftware.htmlunit.html.HtmlPage.refresh(HtmlPage.java:2234)
at org.openqa.selenium.htmlunit.HtmlUnitDriver$HtmlUnitNavigation.refresh(HtmlUnitDriver.java:1282)
at geb.Browser.go(Browser.groovy:395)
at geb.Page.to(Page.groovy:184)
at geb.Browser.via(Browser.groovy:475)
at geb.Browser.to(Browser.groovy:434)
at geb.Browser.to(Browser.groovy:412)
at geb.junit4.GebTest.methodMissing(GebTest.groovy:52)
......
Caused by: net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: syntax error (http://localhost:8081/xyz/static/IKfETRJERwBRdVMGxGDGgTIvzB2B464w7472lQKpd3b.js#156)
at com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.error(StrictErrorReporter.java:64)
at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:187)
at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:167)
at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:219)
at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:214)
at net.sourceforge.htmlunit.corejs.javascript.Parser.mustMatchToken(Parser.java:366)
at net.sourceforge.htmlunit.corejs.javascript.Parser.mustMatchToken(Parser.java:357)
at net.sourceforge.htmlunit.corejs.javascript.Parser.xmlInitializer(Parser.java:2292)
at net.sourceforge.htmlunit.corejs.javascript.Parser.unaryExpr(Parser.java:2252)
at net.sourceforge.htmlunit.corejs.javascript.Parser.mulExpr(Parser.java:2184)
at net.sourceforge.htmlunit.corejs.javascript.Parser.addExpr(Parser.java:2170)
at net.sourceforge.htmlunit.corejs.javascript.Parser.shiftExpr(Parser.java:2153)
at net.sourceforge.htmlunit.corejs.javascript.Parser.relExpr(Parser.java:2130)
at net.sourceforge.htmlunit.corejs.javascript.Parser.eqExpr(Parser.java:2104)
at net.sourceforge.htmlunit.corejs.javascript.Parser.bitAndExpr(Parser.java:2095)
at net.sourceforge.htmlunit.corejs.javascript.Parser.bitXorExpr(Parser.java:2086)
at net.sourceforge.htmlunit.corejs.javascript.Parser.bitOrExpr(Parser.java:2077)
at net.sourceforge.htmlunit.corejs.javascript.Parser.andExpr(Parser.java:2068)
at net.sourceforge.htmlunit.corejs.javascript.Parser.orExpr(Parser.java:2059)
at net.sourceforge.htmlunit.corejs.javascript.Parser.condExpr(Parser.java:2025)
at net.sourceforge.htmlunit.corejs.javascript.Parser.assignExpr(Parser.java:1998)
at net.sourceforge.htmlunit.corejs.javascript.Parser.expr(Parser.java:1979)
at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1025)
at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:891)
at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:535)
at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:456)
at net.sourceforge.htmlunit.corejs.javascript.Context.compileImpl(Context.java:2496)
at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1456)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$TimeoutContext.compileString(HtmlUnitContextFactory.java:201)
at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1448)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$2.doRun(JavaScriptEngine.java:515)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:669)
... 38 more
Enclosed exception:
net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: syntax error (http://localhost:8081/xyz/static/IKfETRJERwBRdVMGxGDGgTIvzB2B464w7472lQKpd3b.js#156)
at com.gargoylesoftware.htmlunit.javascript.StrictErrorReporter.error(StrictErrorReporter.java:64)
at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:187)
at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:167)
at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:219)
at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:214)
at net.sourceforge.htmlunit.corejs.javascript.Parser.mustMatchToken(Parser.java:366)
at net.sourceforge.htmlunit.corejs.javascript.Parser.mustMatchToken(Parser.java:357)
at net.sourceforge.htmlunit.corejs.javascript.Parser.xmlInitializer(Parser.java:2292)
at net.sourceforge.htmlunit.corejs.javascript.Parser.unaryExpr(Parser.java:2252)
at net.sourceforge.htmlunit.corejs.javascript.Parser.mulExpr(Parser.java:2184)
at net.sourceforge.htmlunit.corejs.javascript.Parser.addExpr(Parser.java:2170)
at net.sourceforge.htmlunit.corejs.javascript.Parser.shiftExpr(Parser.java:2153)
at net.sourceforge.htmlunit.corejs.javascript.Parser.relExpr(Parser.java:2130)
at net.sourceforge.htmlunit.corejs.javascript.Parser.eqExpr(Parser.java:2104)
at net.sourceforge.htmlunit.corejs.javascript.Parser.bitAndExpr(Parser.java:2095)
at net.sourceforge.htmlunit.corejs.javascript.Parser.bitXorExpr(Parser.java:2086)
at net.sourceforge.htmlunit.corejs.javascript.Parser.bitOrExpr(Parser.java:2077)
at net.sourceforge.htmlunit.corejs.javascript.Parser.andExpr(Parser.java:2068)
at net.sourceforge.htmlunit.corejs.javascript.Parser.orExpr(Parser.java:2059)
at net.sourceforge.htmlunit.corejs.javascript.Parser.condExpr(Parser.java:2025)
at net.sourceforge.htmlunit.corejs.javascript.Parser.assignExpr(Parser.java:1998)
at net.sourceforge.htmlunit.corejs.javascript.Parser.expr(Parser.java:1979)
at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1025)
at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:891)
at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:535)
at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:456)
at net.sourceforge.htmlunit.corejs.javascript.Context.compileImpl(Context.java:2496)
at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1456)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$TimeoutContext.compileString(HtmlUnitContextFactory.java:201)
at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1448)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$2.doRun(JavaScriptEngine.java:515)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:669)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:602)
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:524)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadJavaScriptFromUrl(HtmlPage.java:1144)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1039)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:409)
at com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:266)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:683)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:642)
at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170)
at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072)
at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330)
at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3116)
at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2083)
at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:918)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:899)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:242)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:188)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268)
at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:437)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:311)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:393)
at com.gargoylesoftware.htmlunit.html.HtmlPage.refresh(HtmlPage.java:2234)
at org.openqa.selenium.htmlunit.HtmlUnitDriver$HtmlUnitNavigation.refresh(HtmlUnitDriver.java:1282)
at geb.Browser.go(Browser.groovy:395)
at geb.Page.to(Page.groovy:184)
at geb.Browser.via(Browser.groovy:475)
at geb.Browser.to(Browser.groovy:434)
at geb.Browser.to(Browser.groovy:412)
at geb.junit4.GebTest.methodMissing(GebTest.groovy:52)
.....
When javascript is not enabled, the tests for pages without javascript pass but tests for pages with javascript get the following:
java.lang.UnsupportedOperationException: Javascript is not enabled for this HtmlUnitDriver instance
at org.openqa.selenium.htmlunit.HtmlUnitDriver.getPageToInjectScriptInto(HtmlUnitDriver.java:639)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.executeScript(HtmlUnitDriver.java:590)
at geb.js.JavascriptInterface._execjs(JavascriptInterface.groovy:41)
at geb.js.JavascriptInterface.exec(JavascriptInterface.groovy:71)
at geb.js.JQueryAdapter._callJQueryMethod(JQueryAdapter.groovy:33)
at geb.js.JQueryAdapter.methodMissing(JQueryAdapter.groovy:60)
at com.sra.ridge.geb.page.RidgePage.populateSecurityQuestions(RidgePage.groovy:95)
at geb.Browser.methodMissing(Browser.groovy:194)
Any suggestions for how to handle these issues? These tests passed when using grails 2.2.3 and geb 0.9.0-RC-1

The syntax error was apparently due to the hashing of javascript files by the resource plugin and setting
grails.resources.mappers.hashandcache.excludes = ['*/']
in the test environment in Config.groovy fixed the issue of the exception.
Using geb 0.9.0-RC1 fixed the issue of the tests running twice. It is unfortunate that we can't upgrade to 0.9.2 of geb.

Related

react-monaco-editor blackout... TypeError: Cannot read property 'pushUndoStop' of undefined

I use "react-monaco-editor" for my project.
import { MonacoDiffEditor } from 'react-monaco-editor';
...
<MonacoDiffEditor
width="1140"
height="520"
language="javascript"
theme="vs-dark"
original={this.props.original}
value={this.props.current}
options={{
renderSideBySide: true,
}}
editorDidMount={this.editorDidMount}
/>
This error can only be viewed after deploy my server.
simpleWorker.js:25 Could not create web worker(s). Falling back to
loading web worker code in main thread, which might cause UI freezes.
Please see https://github.com/microsoft/monaco-editor#faq el #
simpleWorker.js:25 simpleWorker.js:28 You must define a function
MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker el #
simpleWorker.js:28 react-dom.production.min.js:5058 TypeError: Cannot
read property 'pushUndoStop' of undefined
at l.value (diff.js:283)
at ls (react-dom.production.min.js:5163)
at react-dom.production.min.js:6408
at t.unstable_runWithPriority (scheduler.production.min.js:309)
at Ui (react-dom.production.min.js:2816)
at Cl (react-dom.production.min.js:6204)
at cl (react-dom.production.min.js:5895)
at react-dom.production.min.js:2851
at t.unstable_runWithPriority (scheduler.production.min.js:309)
at Ui (react-dom.production.min.js:2816) rs # react-dom.production.min.js:5058
I test in local with nginx, but only serviceWorker warnings logged.
I think that ServiceWorker warnings are http environment in my server.
What is pushUndoStop... I really don't know this error.
help me...
Not sure if you fixed this issue or not by now, since it has been a while, but in case anyone else lands here, I got this issue too. I had v0.20.0 of monaco-editor and v0.35.0 react-monaco-editor which worked fine. Then I updated to v0.23.0 and I ran into this issue as a regression. I then tried v0.25.2 with no change. After that I tried updating react-monaco-editor to the v0.43.0 and the problem stopped happening! I'm thinking it is an issue where they made a change in monaco-editor and if you didn't update react-monaco-editor to a newer version it would break with that error.

AdminCtrl is not using explicit annotation and cannot be invoked in strict? angular meteor

Error Snapshot Development when using ng-strict-di
I am developing project in meteor , If I don't use ng-strict-di in development it works fine but then in production(after making build ) I face following issue :
Error In Production Meteor
Development Error:
Error columnNumber: 12 fileName:
"localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6"
lineNumber: 895 message: "[$injector:strictdi] AdminCtrl is not using
explicit annotation and cannot be invoked in strict
mode\nerrors.angularjs.org/1.6.8/$injector/strictdi?p0=AdminCtrl"
stack:
"minErr/<#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:895:12\nannotate#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:5039:17\ninjectionArgs#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:5833:21\ninvoke#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:5868:18\n$controllerInit#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:11846:24\nnodeLinkFn#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:10709:35\ncompileTemplateUrl/<#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:11117:13\nprocessQueue#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:17939:37\nscheduleProcessQueue/<#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:17987:27\n$digest#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:19122:15\n$apply#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:19419:13\nbootstrapApply#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:2737:9\ninvoke#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:5876:16\ndoBootstrap#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:2735:5\nbootstrap#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:2755:12\nangularInit#localhost:3007/packages/modules.js?hash=f352b06ef868d8ef612a0e02d3fc1da778e4f6d6:2640:5\nangular.js/proto: Object { … }
Production(Build )
Error: [$injector:unpr] Unknown provider: tProvider <- t
errors.angularjs.org/1.6.8/$injector/unpr?p0=tProvider%20%3C-%20t
Stack trace:
r/<#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:7828
he/b.$injector<#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:30527
r#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:29436
he/E<#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:30610
r#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:29436
i#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:29741
a#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:29962
t#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:12:25404
p#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:12:11871
ht/<#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:12:17718
u#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:13:15438
l/<#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:13:15884
$digest#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:13:21599
$apply#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:13:23411
t#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:16603
a#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:30066
a#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:16522
lt#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:16810
ct#localhost:3008/7084ab3720bb9d2b53502cd2b81dce478c095b4c.js?meteor_js_resource=true:11:16046
angular.js/
You're bootstrapping Angular in strict dependency injection mode. This causes angular to throw exceptions when it encounters a dependency that isn't explicitly annotated. This is a way to enforce developers to guard against names of dependencies getting minified.
From the documentation:
If this attribute is present on the app element, the injector will be
created in "strict-di" mode. This means that the application will fail
to invoke functions which do not use explicit function annotation (and
are thus unsuitable for minification), as described in the Dependency
Injection guide, and useful debugging info will assist in tracking
down the root of these bugs.
The error tells you that you havn't explicitly annotated your AdminCtrl-controller. To fix this, your code should look similar to this:
angular.module('app').controller('AdminCtrl', ['firstDependency', 'secondDependency',
function(firstDependency, secondDependency){
// Controller body
}]);
or using $inject:
angular.module('app').controller('AdminCtrl', AdminCtrl);
AdminCtrl.$inject = ['firstDependency', 'secondDependency'];
function AdminCtrl(firstDependency, secondDependency){
// Controller body
}
The second method can be done for you automatically if you use build tools such as grunt, gulp or webpack, along with the ngAnnotate package.

"Got a SIGABRT while executing native code" error while executing .NET native code in node js using mono runtime and edge.js

I need to call a function inside dll file in node js. I am trying to use edge.js for that in ubuntu 15.04.
I installed mono using the instruction given on following url:
Then I installed edge using:
npm install edge
I am trying to call a function in dll. For this i included the dll using following nodejs code:
var ed = require('edge').func('Sample.dll');
but it is throwing following error:
Error: No managed allocator, but we need one for AOT.
Are you using non-standard GC options?
Stacktrace:
at <unknown> <0xffffffff>
at System.Globalization.CultureInfo..cctor () <0x00014>
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0x00062>
at <unknown> <0xffffffff>
at System.IO.FileNotFoundException.SetMessageField () <0x00071>
at System.IO.FileNotFoundException.get_Message () <0x0000c>
at (wrapper runtime-invoke) <Module>.runtime_invoke_object__this__ (object,intptr,intptr,intptr) <0x00069>
Native stacktrace:
/usr/lib/libmonosgen-2.0.so.1(+0xdac0d) [0x7f527a291c0d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10) [0x7f527ad54d10]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f527a9af267]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f527a9b0eca]
/usr/lib/libmonosgen-2.0.so.1(+0x26c1e9) [0x7f527a4231e9]
/usr/lib/libmonosgen-2.0.so.1(+0x26c3f7) [0x7f527a4233f7]
/usr/lib/libmonosgen-2.0.so.1(+0x26c4a2) [0x7f527a4234a2]
/usr/lib/libmonosgen-2.0.so.1(+0xc6170) [0x7f527a27d170]
/usr/lib/libmonosgen-2.0.so.1(+0xc91f4) [0x7f527a2801f4]
/usr/lib/libmonosgen-2.0.so.1(+0xcfefb) [0x7f527a286efb]
/usr/lib/libmonosgen-2.0.so.1(+0xdccdd) [0x7f527a293cdd]
[0x4062ec15]
Debug info from gdb:
No threads.
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Aborted (core dumped)

rails teaspoon Testing in engine Not loading *_spec.js

i'm working on an engine (gem) that has some js code to be tested but seems i can't get it working. I've followed the wiki article and set a basic example, but i'm only getting 0 examples, 0 failures.
Steps done:
Added s.add_development_dependency 'teaspoon-jasmine' in the gemspec file
dummy is in spec/dummy
spec/teaspoon_env.rb:
unless defined?(Rails)
ENV["RAILS_ROOT"] = File.expand_path("../dummy", __FILE__)
require File.expand_path("#{ENV["RAILS_ROOT"]}/config/environment", __FILE__)
end
Teaspoon.configure do |config|
...
config.root = MyEngineName::Engine.root
...
end
Rakefile:
desc "Run the javascript specs"
task :teaspoon => "app:teaspoon"
spec/javascripts/spec_helper.js (default as it was generated)
spec/javascripts/example_spec.js:
describe("My great feature", function() {
it("Bang", () => {
expect(true).toBe(false);
});
});
The problem is that when i try to run the test engine, i'm getting:
$> teaspoon
Starting the Teaspoon server...
Thin web server (v1.7.0 codename Dunder Mifflin)
Maximum connections set to 1024
Listening on 127.0.0.1:57036, CTRL+C to stop
Teaspoon running default suite at http://127.0.0.1:57036/teaspoon/default
Finished in 0.01600 seconds
0 examples, 0 failures
I've also try to run the following commands, with the same result:
$> bundle exec teaspoon
$> rake teaspoon
$> bundle exec teaspoon spec/javascripts/example_spec.js
And even $> bundle exec teaspoon spec/javascripts/non_existent_file_spec.js
I have not much idea of what is not working. As non standard app, i'm using es6 through browserify-rails (which is working ok), and got in engine.rb:
config.browserify_rails.paths = [
lambda { |p| p.start_with?(MyEngineName::Engine.root.join("app").to_s) }
]
Any help or clue would be much appreciated.
UPDATE:
I've created an engine from strach so it is easy to check and reproduce the issue.
Repo Engine example
In particular, the commit related to the teaspoon setup is this one
It is due to the arrow function in your test. Change it to vanilla JS to make it work:
it("Bang", function() {
expect(true).toBe(false);
});
The browser option works just fine with es6.
Try using a Rake command for the Rakefile
rake spec

Running QUnit (TypeScript) tests with Chutzpah gives "Called start() outside of a test context while already started"

I've got a fairly simple repro with an outcome I don't understand.
Make sure you have the Chutpah Test Adapter 4.0.3 installed. Using Visual Studio 2013 take the following steps:
Create a new .NET 4.5.1 class library project;
Add the NuGet package qunit.TypeScript.DefinitelyTyped 0.1.7;
Add a TypeScript file file1.ts to the project with this content:
/// <reference path="./Scripts/typings/qunit/qunit.d.ts"/>
QUnit.test("QUnit is working", assert => assert.ok(true));
Right-click inside that file and pick "Run JS Tests" from the context menu.
I can confirm that file1.js is generated as expected.
The result is that no tests are run, the test explorer shows no tests, and the Test output shows:
Error: Error: Called start() outside of a test context while already started
at start in file:///C:/Users/username/AppData/Local/Microsoft/VisualStudio/12.0/Extensions/abcxyz/TestFiles/QUnit/qunit.js (line 287)
at startQUnit in phantomjs://webpage.evaluate() (line 12)
at onPageLoaded in phantomjs://webpage.evaluate() (line 16)
in phantomjs://webpage.evaluate() (line 18)
While Running:c:\users\username\documents\visual studio 2013\Projects\ClassLibrary3\ClassLibrary3\file1.ts
------ Test started: File: c:\users\username\documents\visual studio 2013\Projects\ClassLibrary3\ClassLibrary3\file1.ts ------
Error: Error: Called start() outside of a test context while already started
While Running:c:\users\username\documents\visual studio 2013\Projects\ClassLibrary3\ClassLibrary3\file1.ts
0 passed, 0 failed, 0 total (chutzpah).
========== Total Tests: 0 passed, 0 failed, 0 total ==========
If I choose the "Open In Browser" Chutzpah context menu item I get a regular QUnit test page, nicely formatted, showing zero tests run.
Obviously the expected result was that one test was successfully run.
What am I missing here?
D'oh! The Chutzpah + TypeScript documentation is actually pretty clear about this:
You need to tell Chutzpah how to compile your files into JavaScript using the compile setting in the chutzpah.json file.
For the scenario from the question take e.g. these steps to get it to work:
Add a chutzpah.json file to the root of your project.
Enter the following code:
{
"Compile": {
"Mode": "External",
"Extensions": [".ts"],
"ExtensionsWithNoOutput": [".d.ts"]
}
}
After this the right-click run will already improve, showing:
========== Total Tests: 1 passed, 0 failed, 1 total ==========
If this doesn't work right away close and re-open the solution.
To get the tests to show up in the Test Explorer you need to group them into modules, e.g. by adding this to file1.ts:
QUnit.module("Qu.Testing");
For more info, see the Compile Setting documentation.
Leaving this up here should others fall in the same trap I did.

Categories

Resources