You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guess what ? I get an AssertionError "expected undefined should exist"
What's the culprit: var a= or var b= ?
No way to tell.
So I've dug in the gagarin codebase and added
chai.Assertion.includeStack=true;
at backdoor.js:15
and
console.log("COMPILED",code);
to the compile() function also in backdoor.js.
Now I get:
server COMPILED function (chai, Fiber, expect, assert, either) {
server return function () {
server 'use strict';
server return (function (userFunc, getClosure, action) {
server try {
server console.log(action);
server return action(userFunc, getClosure);
server } catch (err) {
server console.error('ERR', err);
server return { error: err.message, stack: err.stack, closure: getClosure() };
server }
server })(
server function () {
server var a = doSomething();
server expect(a).to.exist;
server var b = doSomethingWithA(a);
server expect(b).to.exist; },
server function () {
server return { };
server },
server arguments[arguments.length-1]
server );
server }
server }
and
AssertionError: expected undefined to exist\n at [object Object].<anonymous> (...chai/core/assertions.js:340:10)\n at [object Object].Object.defineProperty.get (..chai/utils/addProperty.js:35:29)\n at Object.<anonymous> (evalmachine.<anonymous>:15:32)\n at packages/anti_gagarin/meteor/backdoor.js:44:1\n at userId (evalmachine.<anonymous>:7:16)\n at Object.<anonymous> (evalmachine.<anonymous>:12:7)\n at [object Object].Meteor.methods./gagarin/execute (packages/anti_gagarin/meteor/backdoor.js:42:1)\n at [object Object].methodMap.(anonymous function) (packages/meteorhacks_kadira/lib/hijack/wrap_session.js:164:1)\n at maybeAuditArgumentChecks (livedata_server.js:1698:12)\n at livedata_server.js:708:19
So I can count lines and deduce that the line in error is var b=.
How can I automate this?
The text was updated successfully, but these errors were encountered:
It's a very important problem you are pointing out here. I've been working on this some time ago and eventually gave up because it turned out stack traces are totally unpredictable in browsers when it comes to evaluating dynamically included code like in our case. So I gave up, but it's probably something that will need to be solved eventually. Please let me know about the results of your research.
Good to know.
I've not tackled the browser.execute() stacktraces yet.
The latest commit in the PR is for server.execute(), though.
Maybe it's more reliable...
Hi,
I'm writing server-side tests by calling
Guess what ? I get an AssertionError "expected undefined should exist"
What's the culprit:
var a=
orvar b=
?No way to tell.
So I've dug in the gagarin codebase and added
at backdoor.js:15
and
to the compile() function also in backdoor.js.
Now I get:
and
So I can count lines and deduce that the line in error is
var b=
.How can I automate this?
The text was updated successfully, but these errors were encountered: