text: 'use strict';'use-strict';var cov_18x8kxxxz6=function(){var path="C:\\Users\\Angel Barusta\\Desktop\\nodejs\\iot_nodejs\\tests\\agent-tests.js",hash="ba6fe26c8ec439b88dc967ad44b309b11d16bb89",Function=function(){}.constructor,global=new Function('return this')(),gcv="__coverage__",coverageData={path:"C:\\Users\\Angel Barusta\\Desktop\\nodejs\\iot_nodejs\\tests\\agent-tests.js",statementMap:{"0":{start:{line:4,column:30},end:{line:4,column:5630}},"1":{start:{line:5,column:27},end:{line:5,column:486}},"2":{start:{line:5,column:74},end:{line:5,column:93}},"3":{start:{line:5,column:96},end:{line:5,column:236}},"4":{start:{line:5,column:166},end:{line:5,column:219}},"5":{start:{line:5,column:220},end:{line:5,column:233}},"6":{start:{line:5,column:237},end:{line:5,column:454}},"7":{start:{line:5,column:328},end:{line:5,column:341}},"8":{start:{line:5,column:343},end:{line:5,column:362}},"9":{start:{line:5,column:363},end:{line:5,column:451}},"10":{start:{line:5,column:455},end:{line:5,column:482}},"11":{start:{line:7,column:13},end:{line:7,column:27}},"12":{start:{line:8,column:14},end:{line:8,column:30}},"13":{start:{line:9,column:19},end:{line:9,column:40}},"14":{start:{line:10,column:22},end:{line:10,column:49}},"15":{start:{line:12,column:13},end:{line:14,column:1}},"16":{start:{line:17,column:17},end:{line:22,column:1}},"17":{start:{line:22,column:11},end:{line:22,column:12}},"18":{start:{line:23,column:11},end:{line:23,column:24}},"19":{start:{line:24,column:16},end:{line:24,column:20}},"20":{start:{line:25,column:9},end:{line:25,column:13}},"21":{start:{line:26,column:14},end:{line:26,column:18}},"22":{start:{line:29,column:13},end:{line:29,column:52}},"23":{start:{line:31,column:20},end:{line:35,column:1}},"24":{start:{line:35,column:21},end:{line:38,column:1}},"25":{start:{line:38,column:17},end:{line:41,column:1}},"26":{start:{line:41,column:17},end:{line:48,column:1}},"27":{start:{line:50,column:23},end:{line:67,column:1}},"28":{start:{line:67,column:2},end:{line:106,column:3}},"29":{start:{line:68,column:2},end:{line:68,column:34}},"30":{start:{line:70,column:2},end:{line:75,column:4}},"31":{start:{line:75,column:4},end:{line:75,column:38}},"32":{start:{line:76,column:2},end:{line:80,column:6}},"33":{start:{line:78,column:6},end:{line:78,column:22}},"34":{start:{line:83,column:2},end:{line:83,column:36}},"35":{start:{line:84,column:2},end:{line:84,column:79}},"36":{start:{line:87,column:2},end:{line:87,column:38}},"37":{start:{line:88,column:2},end:{line:88,column:83}},"38":{start:{line:91,column:2},end:{line:91,column:37}},"39":{start:{line:92,column:2},end:{line:92,column:92}},"40":{start:{line:95,column:2},end:{line:95,column:37}},"41":{start:{line:96,column:2},end:{line:96,column:75}},"42":{start:{line:97,column:2},end:{line:97,column:94}},"43":{start:{line:98,column:2},end:{line:98,column:87}},"44":{start:{line:100,column:24},end:{line:103,column:4}},"45":{start:{line:101,column:28},end:{line:101,column:37}},"46":{start:{line:102,column:29},end:{line:102,column:39}},"47":{start:{line:105,column:2},end:{line:105,column:35}},"48":{start:{line:108,column:0},end:{line:110,column:3}},"49":{start:{line:109,column:2},end:{line:109,column:31}},"50":{start:{line:112,column:0},end:{line:124,column:3}},"51":{start:{line:113,column:13},end:{line:113,column:39}},"52":{start:{line:116,column:2},end:{line:123,column:36}},"53":{start:{line:127,column:0},end:{line:165,column:3}},"54":{start:{line:128,column:14},end:{line:128,column:40}},"55":{start:{line:129,column:14},end:{line:129,column:40}},"56":{start:{line:130,column:14},end:{line:130,column:40}},"57":{start:{line:131,column:14},end:{line:131,column:40}},"58":{start:{line:133,column:2},end:{line:140,column:42}},"59":{start:{line:141,column:2},end:{line:148,column:34}},"60":{start:{line:149,column:2},end:{line:156,column:45}},"61":{start:{line:157,column:2},end:{line:164,column:35}},"62":{start:{line:167,column:0},end:{line:203,column:3}},"63":{start:{line:168,column:14},end:{line:168,column:40}},"64":{start:{line:169,column:14},end:{line:169,column:40}},"65":{start:{line:170,column:14},end:{line:170,column:40}},"66":{start:{line:172,column:14},end:{line:172,column:41}},"67":{start:{line:174,column:2},end:{line:182,column:42}},"68":{start:{line:183,column:2},end:{line:191,column:45}},"69":{start:{line:192,column:2},end:{line:200,column:59}},"70":{start:{line:202,column:2},end:{line:202,column:69}},"71":{start:{line:205,column:0},end:{line:241,column:3}},"72":{start:{line:206,column:14},end:{line:206,column:40}},"73":{start:{line:207,column:15},end:{line:207,column:41}},"74":{start:{line:208,column:15},end:{line:208,column:41}},"75":{start:{line:210,column:14},end:{line:210,column:45}},"76":{start:{line:212,column:2},end:{line:220,column:40}},"77":{start:{line:221,column:2},end:{line:229,column:46}},"78":{start:{line:230,column:2},end:{line:238,column:46}},"79":{start:{line:240,column:2},end:{line:240,column:78}},"80":{start:{line:243,column:0},end:{line:280,column:3}},"81":{start:{line:244,column:15},end:{line:244,column:41}},"82":{start:{line:245,column:15},end:{line:245,column:41}},"83":{start:{line:246,column:15},end:{line:246,column:41}},"84":{start:{line:248,column:15},end:{line:248,column:39}},"85":{start:{line:250,column:2},end:{line:258,column:36}},"86":{start:{line:259,column:2},end:{line:267,column:49}},"87":{start:{line:268,column:2},end:{line:276,column:51}},"88":{start:{line:278,column:2},end:{line:278,column:81}},"89":{start:{line:279,column:2},end:{line:279,column:74}},"90":{start:{line:282,column:0},end:{line:319,column:3}},"91":{start:{line:283,column:15},end:{line:283,column:41}},"92":{start:{line:284,column:15},end:{line:284,column:41}},"93":{start:{line:285,column:15},end:{line:285,column:41}},"94":{start:{line:287,column:15},end:{line:287,column:45}},"95":{start:{line:289,column:2},end:{line:297,column:41}},"96":{start:{line:298,column:2},end:{line:306,column:49}},"97":{start:{line:307,column:2},end:{line:315,column:51}},"98":{start:{line:317,column:2},end:{line:317,column:83}},"99":{start:{line:318,column:2},end:{line:318,column:77}},"100":{start:{line:322,column:0},end:{line:359,column:3}},"101":{start:{line:323,column:15},end:{line:323,column:41}},"102":{start:{line:324,column:15},end:{line:324,column:41}},"103":{start:{line:325,column:15},end:{line:325,column:41}},"104":{start:{line:327,column:15},end:{line:327,column:51}},"105":{start:{line:329,column:2},end:{line:337,column:41}},"106":{start:{line:338,column:2},end:{line:346,column:49}},"107":{start:{line:347,column:2},end:{line:355,column:51}},"108":{start:{line:357,column:2},end:{line:357,column:81}},"109":{start:{line:358,column:2},end:{line:358,column:74}},"110":{start:{line:361,column:0},end:{line:427,column:3}},"111":{start:{line:362,column:15},end:{line:362,column:41}},"112":{start:{line:363,column:15},end:{line:363,column:41}},"113":{start:{line:364,column:15},end:{line:364,column:41}},"114":{start:{line:365,column:15},end:{line:365,column:41}},"115":{start:{line:366,column:15},end:{line:366,column:41}},"116":{start:{line:367,column:15},end:{line:367,column:41}},"117":{start:{line:369,column:14},end:{line:369,column:51}},"118":{start:{line:371,column:2},end:{line:379,column:41}},"119":{start:{line:380,column:2},end:{line:388,column:41}},"120":{start:{line:389,column:2},end:{line:397,column:49}},"121":{start:{line:398,column:2},end:{line:406,column:38}},"122":{start:{line:407,column:2},end:{line:415,column:48}},"123":{start:{line:416,column:2},end:{line:424,column:55}},"124":{start:{line:426,column:2},end:{line:426,column:62}},"125":{start:{line:429,column:0},end:{line:442,column:3}},"126":{start:{line:430,column:14},end:{line:430,column:53}},"127":{start:{line:441,column:2},end:{line:441,column:60}}},fnMap:{"0":{name:"(anonymous_0)",decl:{start:{line:5,column:27},end:{line:5,column:28}},loc:{start:{line:5,column:39},end:{line:5,column:484}},line:5},"1":{name:"PowerAssertRecorder",decl:{start:{line:5,column:50},end:{line:5,column:69}},loc:{start:{line:5,column:72},end:{line:5,column:95}},line:5},"2":{name:"_capt",decl:{start:{line:5,column:143},end:{line:5,column:148}},loc:{start:{line:5,column:164},end:{line:5,column:235}},line:5},"3":{name:"_expr",decl:{start:{line:5,column:284},end:{line:5,column:289}},loc:{start:{line:5,column:305},end:{line:5,column:453}},line:5},"4":{name:"(anonymous_4)",decl:{start:{line:13,column:2},end:{line:13,column:3}},loc:{start:{line:13,column:12},end:{line:13,column:14}},line:13},"5":{name:"(anonymous_5)",decl:{start:{line:67,column:18},end:{line:67,column:19}},loc:{start:{line:67,column:30},end:{line:106,column:1}},line:67},"6":{name:"(anonymous_6)",decl:{start:{line:77,column:4},end:{line:77,column:5}},loc:{start:{line:77,column:13},end:{line:79,column:5}},line:77},"7":{name:"(anonymous_7)",decl:{start:{line:101,column:22},end:{line:101,column:23}},loc:{start:{line:101,column:28},end:{line:101,column:37}},line:101},"8":{name:"(anonymous_8)",decl:{start:{line:102,column:23},end:{line:102,column:24}},loc:{start:{line:102,column:29},end:{line:102,column:39}},line:102},"9":{name:"(anonymous_9)",decl:{start:{line:108,column:15},end:{line:108,column:16}},loc:{start:{line:108,column:21},end:{line:110,column:1}},line:108},"10":{name:"(anonymous_10)",decl:{start:{line:112,column:14},end:{line:112,column:15}},loc:{start:{line:112,column:19},end:{line:124,column:1}},line:112},"11":{name:"(anonymous_11)",decl:{start:{line:127,column:21},end:{line:127,column:22}},loc:{start:{line:127,column:26},end:{line:165,column:1}},line:127},"12":{name:"(anonymous_12)",decl:{start:{line:167,column:30},end:{line:167,column:31}},loc:{start:{line:167,column:41},end:{line:203,column:1}},line:167},"13":{name:"(anonymous_13)",decl:{start:{line:205,column:32},end:{line:205,column:33}},loc:{start:{line:205,column:43},end:{line:241,column:1}},line:205},"14":{name:"(anonymous_14)",decl:{start:{line:243,column:29},end:{line:243,column:30}},loc:{start:{line:243,column:40},end:{line:280,column:1}},line:243},"15":{name:"(anonymous_15)",decl:{start:{line:282,column:35},end:{line:282,column:36}},loc:{start:{line:282,column:46},end:{line:319,column:1}},line:282},"16":{name:"(anonymous_16)",decl:{start:{line:322,column:36},end:{line:322,column:37}},loc:{start:{line:322,column:47},end:{line:359,column:1}},line:322},"17":{name:"(anonymous_17)",decl:{start:{line:361,column:45},end:{line:361,column:46}},loc:{start:{line:361,column:56},end:{line:427,column:1}},line:361},"18":{name:"(anonymous_18)",decl:{start:{line:429,column:42},end:{line:429,column:43}},loc:{start:{line:429,column:53},end:{line:442,column:1}},line:429}},branchMap:{"0":{loc:{start:{line:109,column:2},end:{line:109,column:30}},type:"binary-expr",locations:[{start:{line:109,column:2},end:{line:109,column:9}},{start:{line:109,column:13},end:{line:109,column:30}}],line:109}},s:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0},f:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0},b:{"0":[0,0]},_coverageSchema:"43e27e138ebf9cfc5966b082cf9a028302ed4184"},coverage=global[gcv]||(global[gcv]={});if(coverage[path]&&coverage[path].hash===hash){return coverage[path];}coverageData.hash=hash;return coverage[path]=coverageData;}();var _powerAssertVisitorKeys=(cov_18x8kxxxz6.s[0]++,'{"ArrayExpression":["elements"],"AssignmentExpression":["left","right"],"BinaryExpression":["left","right"],"Directive":["value"],"DirectiveLiteral":[],"BlockStatement":["directives","body"],"BreakStatement":["label"],"CallExpression":["callee","arguments"],"CatchClause":["param","body"],"ConditionalExpression":["test","consequent","alternate"],"ContinueStatement":["label"],"DebuggerStatement":[],"DoWhileStatement":["test","body"],"EmptyStatement":[],"ExpressionStatement":["expression"],"File":["program"],"ForInStatement":["left","right","body"],"ForStatement":["init","test","update","body"],"FunctionDeclaration":["id","params","body","returnType","typeParameters"],"FunctionExpression":["id","params","body","returnType","typeParameters"],"Identifier":["typeAnnotation"],"IfStatement":["test","consequent","alternate"],"LabeledStatement":["label","body"],"StringLiteral":[],"NumericLiteral":[],"NullLiteral":[],"BooleanLiteral":[],"RegExpLiteral":[],"LogicalExpression":["left","right"],"MemberExpression":["object","property"],"NewExpression":["callee","arguments"],"Program":["directives","body"],"ObjectExpression":["properties"],"ObjectMethod":["key","params","body","decorators","returnType","typeParameters"],"ObjectProperty":["key","value","decorators"],"RestElement":["argument","typeAnnotation"],"ReturnStatement":["argument"],"SequenceExpression":["expressions"],"SwitchCase":["test","consequent"],"SwitchStatement":["discriminant","cases"],"ThisExpression":[],"ThrowStatement":["argument"],"TryStatement":["block","handler","finalizer"],"UnaryExpression":["argument"],"UpdateExpression":["argument"],"VariableDeclaration":["declarations"],"VariableDeclarator":["id","init"],"WhileStatement":["test","body"],"WithStatement":["object","body"],"AssignmentPattern":["left","right"],"ArrayPattern":["elements","typeAnnotation"],"ArrowFunctionExpression":["params","body","returnType","typeParameters"],"ClassBody":["body"],"ClassDeclaration":["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],"ClassExpression":["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],"ExportAllDeclaration":["source"],"ExportDefaultDeclaration":["declaration"],"ExportNamedDeclaration":["declaration","specifiers","source"],"ExportSpecifier":["local","exported"],"ForOfStatement":["left","right","body"],"ImportDeclaration":["specifiers","source"],"ImportDefaultSpecifier":["local"],"ImportNamespaceSpecifier":["local"],"ImportSpecifier":["local","imported"],"MetaProperty":["meta","property"],"ClassMethod":["key","params","body","decorators","returnType","typeParameters"],"ObjectPattern":["properties","typeAnnotation"],"SpreadElement":["argument"],"Super":[],"TaggedTemplateExpression":["tag","quasi"],"TemplateElement":[],"TemplateLiteral":["quasis","expressions"],"YieldExpression":["argument"],"AnyTypeAnnotation":[],"ArrayTypeAnnotation":["elementType"],"BooleanTypeAnnotation":[],"BooleanLiteralTypeAnnotation":[],"NullLiteralTypeAnnotation":[],"ClassImplements":["id","typeParameters"],"ClassProperty":["key","value","typeAnnotation","decorators"],"DeclareClass":["id","typeParameters","extends","body"],"DeclareFunction":["id"],"DeclareInterface":["id","typeParameters","extends","body"],"DeclareModule":["id","body"],"DeclareModuleExports":["typeAnnotation"],"DeclareTypeAlias":["id","typeParameters","right"],"DeclareOpaqueType":["id","typeParameters","supertype"],"DeclareVariable":["id"],"DeclareExportDeclaration":["declaration","specifiers","source"],"ExistentialTypeParam":[],"FunctionTypeAnnotation":["typeParameters","params","rest","returnType"],"FunctionTypeParam":["name","typeAnnotation"],"GenericTypeAnnotation":["id","typeParameters"],"InterfaceExtends":["id","typeParameters"],"InterfaceDeclaration":["id","typeParameters","extends","body"],"IntersectionTypeAnnotation":["types"],"MixedTypeAnnotation":[],"EmptyTypeAnnotation":[],"NullableTypeAnnotation":["typeAnnotation"],"NumericLiteralTypeAnnotation":[],"NumberTypeAnnotation":[],"StringLiteralTypeAnnotation":[],"StringTypeAnnotation":[],"ThisTypeAnnotation":[],"TupleTypeAnnotation":["types"],"TypeofTypeAnnotation":["argument"],"TypeAlias":["id","typeParameters","right"],"OpaqueType":["id","typeParameters","impltype","supertype"],"TypeAnnotation":["typeAnnotation"],"TypeCastExpression":["expression","typeAnnotation"],"TypeParameter":["bound"],"TypeParameterDeclaration":["params"],"TypeParameterInstantiation":["params"],"ObjectTypeAnnotation":["properties","indexers","callProperties"],"ObjectTypeCallProperty":["value"],"ObjectTypeIndexer":["id","key","value"],"ObjectTypeProperty":["key","value"],"ObjectTypeSpreadProperty":["argument"],"QualifiedTypeIdentifier":["id","qualification"],"UnionTypeAnnotation":["types"],"VoidTypeAnnotation":[],"JSXAttribute":["name","value"],"JSXClosingElement":["name"],"JSXElement":["openingElement","children","closingElement"],"JSXEmptyExpression":[],"JSXExpressionContainer":["expression"],"JSXSpreadChild":["expression"],"JSXIdentifier":[],"JSXMemberExpression":["object","property"],"JSXNamespacedName":["namespace","name"],"JSXOpeningElement":["name","attributes"],"JSXSpreadAttribute":["argument"],"JSXText":[],"Noop":[],"ParenthesizedExpression":["expression"],"AwaitExpression":["argument"],"ForAwaitStatement":["left","right","body"],"BindExpression":["object","callee"],"Import":[],"Decorator":["expression"],"DoExpression":["body"],"ExportDefaultSpecifier":["exported"],"ExportNamespaceSpecifier":["exported"],"RestProperty":["argument"],"SpreadProperty":["argument"]}'),_powerAssertRecorder=(cov_18x8kxxxz6.s[1]++,function(){cov_18x8kxxxz6.f[0]++;function PowerAssertRecorder(){cov_18x8kxxxz6.f[1]++;cov_18x8kxxxz6.s[2]++;this.captured=[];}cov_18x8kxxxz6.s[3]++;PowerAssertRecorder.prototype._capt=function _capt(value,espath){cov_18x8kxxxz6.f[2]++;cov_18x8kxxxz6.s[4]++;this.captured.push({value:value,espath:espath});cov_18x8kxxxz6.s[5]++;return value;};cov_18x8kxxxz6.s[6]++;PowerAssertRecorder.prototype._expr=function _expr(value,source){cov_18x8kxxxz6.f[3]++;var capturedValues=(cov_18x8kxxxz6.s[7]++,this.captured);cov_18x8kxxxz6.s[8]++;this.captured=[];cov_18x8kxxxz6.s[9]++;return{powerAssertContext:{value:value,events:capturedValues},source:source};};cov_18x8kxxxz6.s[10]++;return PowerAssertRecorder;}());const test=(cov_18x8kxxxz6.s[11]++,require('ava'));const sinon=(cov_18x8kxxxz6.s[12]++,require('sinon'));const proxyquire=(cov_18x8kxxxz6.s[13]++,require('proxyquire'));const agentFixtures=(cov_18x8kxxxz6.s[14]++,require('./fixtures/agent'));// ----------------------------------------------------------
  let config=(cov_18x8kxxxz6.s[15]++,{logging(){cov_18x8kxxxz6.f[4]++;}});// ----------------------------------------------------
  let MetricStub=(cov_18x8kxxxz6.s[16]++,{belongsTo:sinon.spy()// un spy es un funcion que nos dice datos sobre la funcion, es un chicmoso vamos
  // -------------------------------------------------------------
  });let id=(cov_18x8kxxxz6.s[17]++,1);let uuid=(cov_18x8kxxxz6.s[18]++,'yyy-yyy-yyy');let AgentStub=(cov_18x8kxxxz6.s[19]++,null);let db=(cov_18x8kxxxz6.s[20]++,null);let sandbox=(cov_18x8kxxxz6.s[21]++,null);// ----------------------------------------------
  let single=(cov_18x8kxxxz6.s[22]++,Object.assign({},agentFixtures.single));// -----------------------------------------------------------------
  let connectedArgs=(cov_18x8kxxxz6.s[23]++,{where:{connected:true//------------------------------------------------------------
  }});let usernameArgs=(cov_18x8kxxxz6.s[24]++,{where:{username:'iot',connected:true// ------------------------------------------------------------
  }});let uuidArgs=(cov_18x8kxxxz6.s[25]++,{where:{uuid// -------------------------------------------------------------
  }});let newAgent=(cov_18x8kxxxz6.s[26]++,{uuid:'123-123-123',name:'test',username:'iot',hostname:'test',pid:0,connected:false});let newAgentUuidArgs=(cov_18x8kxxxz6.s[27]++,{where:{uuid:newAgent.uuid/*test.beforeEach(async () => {
      AgentStub.findOne = sandbox.stub()
      AgentStub.findOne.withArgs(uuidArgs).returns(Promise.resolve(agentFixtures.findByUuid(uuid)))
      AgentStub.findOne.withArgs(newAgentUuidArgs).returns(Promise.resolve(agentFixtures.findByUuid(newAgent.uuid)))
    })*/ /* let uuidArgs = {
      where: {
        uuid
      }
    } */}});cov_18x8kxxxz6.s[28]++;test.beforeEach(async()=>{cov_18x8kxxxz6.f[5]++;cov_18x8kxxxz6.s[29]++;sandbox=sinon.createSandbox();cov_18x8kxxxz6.s[30]++;AgentStub={// un sandbox es un ambiente especifico que solo funciona para este caso en particular
  hasMany:sandbox.spy()// Model create Stub
  };cov_18x8kxxxz6.s[31]++;AgentStub.create=sandbox.stub();cov_18x8kxxxz6.s[32]++;AgentStub.create.withArgs(newAgent).returns(Promise.resolve({toJSON(){cov_18x8kxxxz6.f[6]++;cov_18x8kxxxz6.s[33]++;return newAgent;}}));// Model update Stub
  cov_18x8kxxxz6.s[34]++;AgentStub.update=sandbox.stub();cov_18x8kxxxz6.s[35]++;AgentStub.update.withArgs(single,uuidArgs).returns(Promise.resolve(single));// Modelo findById Stub
  cov_18x8kxxxz6.s[36]++;AgentStub.findById=sandbox.stub();cov_18x8kxxxz6.s[37]++;AgentStub.findById.withArgs(id).returns(Promise.resolve(agentFixtures.byId(id)));// Model findOne Stub
  cov_18x8kxxxz6.s[38]++;AgentStub.findOne=sandbox.stub();cov_18x8kxxxz6.s[39]++;AgentStub.findOne.withArgs(uuidArgs).returns(Promise.resolve(agentFixtures.byUuid(uuid)));// Model findAll Stub
  cov_18x8kxxxz6.s[40]++;AgentStub.findAll=sandbox.stub();cov_18x8kxxxz6.s[41]++;AgentStub.findAll.withArgs().returns(Promise.resolve(agentFixtures.all));cov_18x8kxxxz6.s[42]++;AgentStub.findAll.withArgs(connectedArgs).returns(Promise.resolve(agentFixtures.connected));cov_18x8kxxxz6.s[43]++;AgentStub.findAll.withArgs(usernameArgs).returns(Promise.resolve(agentFixtures.iot));const setupDatabase=(cov_18x8kxxxz6.s[44]++,proxyquire('../',{'./models/agent':()=>{cov_18x8kxxxz6.f[7]++;cov_18x8kxxxz6.s[45]++;return AgentStub;},// las mismas rutas que las que estan e declaradas en index.js
  './models/metric':()=>{cov_18x8kxxxz6.f[8]++;cov_18x8kxxxz6.s[46]++;return MetricStub;}}));cov_18x8kxxxz6.s[47]++;db=await setupDatabase(config);});cov_18x8kxxxz6.s[48]++;test.afterEach(()=>{cov_18x8kxxxz6.f[9]++;cov_18x8kxxxz6.s[49]++;(cov_18x8kxxxz6.b[0][0]++,sandbox)&&(cov_18x8kxxxz6.b[0][1]++,sandbox.restore());});cov_18x8kxxxz6.s[50]++;test('Agent',t=>{cov_18x8kxxxz6.f[10]++;var _rec=(cov_18x8kxxxz6.s[51]++,new _powerAssertRecorder());// verificacion de que Agent exista
  cov_18x8kxxxz6.s[52]++;t.truthy(_rec._expr(_rec._capt(_rec._capt(db,'arguments/0/object').Agent,'arguments/0'),{content:'t.truthy(db.Agent, \'Agent service should exist\')',filepath:'tests\\agent-tests.js',line:112,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"truthy","range":[2,8]},"computed":false,"range":[0,8]},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"db","range":[9,11]},"property":{"type":"Identifier","name":"Agent","range":[12,17]},"computed":false,"range":[9,17]},{"type":"StringLiteral","value":"Agent service should exist","range":[19,47]}],"range":[0,48]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"name"},"value":"truthy","range":[2,8]},{"type":{"label":"("},"range":[8,9]},{"type":{"label":"name"},"value":"db","range":[9,11]},{"type":{"label":"."},"range":[11,12]},{"type":{"label":"name"},"value":"Agent","range":[12,17]},{"type":{"label":","},"range":[17,18]},{"type":{"label":"string"},"value":"Agent service should exist","range":[19,47]},{"type":{"label":")"},"range":[47,48]}]',visitorKeys:_powerAssertVisitorKeys}),'Agent service should exist');// si se resulve el valor a verdadero
  });// ----------------------------------------------------------------
  cov_18x8kxxxz6.s[53]++;test.serial('Setup',t=>{cov_18x8kxxxz6.f[11]++;var _rec2=(cov_18x8kxxxz6.s[54]++,new _powerAssertRecorder()),_rec3=(cov_18x8kxxxz6.s[55]++,new _powerAssertRecorder()),_rec4=(cov_18x8kxxxz6.s[56]++,new _powerAssertRecorder()),_rec5=(cov_18x8kxxxz6.s[57]++,new _powerAssertRecorder());cov_18x8kxxxz6.s[58]++;t.true(_rec2._expr(_rec2._capt(_rec2._capt(_rec2._capt(AgentStub,'arguments/0/object/object').hasMany,'arguments/0/object').called,'arguments/0'),{content:'t.true(AgentStub.hasMany.called, \'AgentModel.hasMany fue ejecutada\')',filepath:'tests\\agent-tests.js',line:117,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"hasMany","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"AgentModel.hasMany fue ejecutada","range":[33,67]}],"range":[0,68]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"hasMany","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"AgentModel.hasMany fue ejecutada","range":[33,67]},{"type":{"label":")"},"range":[67,68]}]',visitorKeys:_powerAssertVisitorKeys}),'AgentModel.hasMany fue ejecutada');cov_18x8kxxxz6.s[59]++;t.true(_rec3._expr(_rec3._capt(_rec3._capt(_rec3._capt(AgentStub,'arguments/0/callee/object/object').hasMany,'arguments/0/callee/object').calledWith(_rec3._capt(MetricStub,'arguments/0/arguments/0')),'arguments/0'),{content:'t.true(AgentStub.hasMany.calledWith(MetricStub), \'Argumento de esa funcion\')',filepath:'tests\\agent-tests.js',line:118,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"hasMany","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"MetricStub","range":[36,46]}],"range":[7,47]},{"type":"StringLiteral","value":"Argumento de esa funcion","range":[49,75]}],"range":[0,76]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"hasMany","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"MetricStub","range":[36,46]},{"type":{"label":")"},"range":[46,47]},{"type":{"label":","},"range":[47,48]},{"type":{"label":"string"},"value":"Argumento de esa funcion","range":[49,75]},{"type":{"label":")"},"range":[75,76]}]',visitorKeys:_powerAssertVisitorKeys}),'Argumento de esa funcion');cov_18x8kxxxz6.s[60]++;t.true(_rec4._expr(_rec4._capt(_rec4._capt(_rec4._capt(MetricStub,'arguments/0/object/object').belongsTo,'arguments/0/object').called,'arguments/0'),{content:'t.true(MetricStub.belongsTo.called, \'MetricModel.belongsTo fue ejecutada\')',filepath:'tests\\agent-tests.js',line:119,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"MetricStub","range":[7,17]},"property":{"type":"Identifier","name":"belongsTo","range":[18,27]},"computed":false,"range":[7,27]},"property":{"type":"Identifier","name":"called","range":[28,34]},"computed":false,"range":[7,34]},{"type":"StringLiteral","value":"MetricModel.belongsTo fue ejecutada","range":[36,73]}],"range":[0,74]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"MetricStub","range":[7,17]},{"type":{"label":"."},"range":[17,18]},{"type":{"label":"name"},"value":"belongsTo","range":[18,27]},{"type":{"label":"."},"range":[27,28]},{"type":{"label":"name"},"value":"called","range":[28,34]},{"type":{"label":","},"range":[34,35]},{"type":{"label":"string"},"value":"MetricModel.belongsTo fue ejecutada","range":[36,73]},{"type":{"label":")"},"range":[73,74]}]',visitorKeys:_powerAssertVisitorKeys}),'MetricModel.belongsTo fue ejecutada');cov_18x8kxxxz6.s[61]++;t.true(_rec5._expr(_rec5._capt(_rec5._capt(_rec5._capt(MetricStub,'arguments/0/callee/object/object').belongsTo,'arguments/0/callee/object').calledWith(_rec5._capt(AgentStub,'arguments/0/arguments/0')),'arguments/0'),{content:'t.true(MetricStub.belongsTo.calledWith(AgentStub), \'Argumentos de esa funcion\')',filepath:'tests\\agent-tests.js',line:120,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"MetricStub","range":[7,17]},"property":{"type":"Identifier","name":"belongsTo","range":[18,27]},"computed":false,"range":[7,27]},"property":{"type":"Identifier","name":"calledWith","range":[28,38]},"computed":false,"range":[7,38]},"arguments":[{"type":"Identifier","name":"AgentStub","range":[39,48]}],"range":[7,49]},{"type":"StringLiteral","value":"Argumentos de esa funcion","range":[51,78]}],"range":[0,79]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"MetricStub","range":[7,17]},{"type":{"label":"."},"range":[17,18]},{"type":{"label":"name"},"value":"belongsTo","range":[18,27]},{"type":{"label":"."},"range":[27,28]},{"type":{"label":"name"},"value":"calledWith","range":[28,38]},{"type":{"label":"("},"range":[38,39]},{"type":{"label":"name"},"value":"AgentStub","range":[39,48]},{"type":{"label":")"},"range":[48,49]},{"type":{"label":","},"range":[49,50]},{"type":{"label":"string"},"value":"Argumentos de esa funcion","range":[51,78]},{"type":{"label":")"},"range":[78,79]}]',visitorKeys:_powerAssertVisitorKeys}),'Argumentos de esa funcion');});// --------------------------------------------------------------------------
  cov_18x8kxxxz6.s[62]++;test.serial('Agent#findById',async t=>{cov_18x8kxxxz6.f[12]++;var _rec6=(cov_18x8kxxxz6.s[63]++,new _powerAssertRecorder()),_rec7=(cov_18x8kxxxz6.s[64]++,new _powerAssertRecorder()),_rec8=(cov_18x8kxxxz6.s[65]++,new _powerAssertRecorder());let agent=(cov_18x8kxxxz6.s[66]++,await db.Agent.findById(id));cov_18x8kxxxz6.s[67]++;t.true(_rec6._expr(_rec6._capt(_rec6._capt(_rec6._capt(AgentStub,'arguments/0/object/object').findById,'arguments/0/object').called,'arguments/0'),{content:'t.true(AgentStub.findById.called, \'findById debera llamar al modelo\')',filepath:'tests\\agent-tests.js',line:126,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findById","range":[17,25]},"computed":false,"range":[7,25]},"property":{"type":"Identifier","name":"called","range":[26,32]},"computed":false,"range":[7,32]},{"type":"StringLiteral","value":"findById debera llamar al modelo","range":[34,68]}],"range":[0,69]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findById","range":[17,25]},{"type":{"label":"."},"range":[25,26]},{"type":{"label":"name"},"value":"called","range":[26,32]},{"type":{"label":","},"range":[32,33]},{"type":{"label":"string"},"value":"findById debera llamar al modelo","range":[34,68]},{"type":{"label":")"},"range":[68,69]}]',visitorKeys:_powerAssertVisitorKeys}),'findById debera llamar al modelo');cov_18x8kxxxz6.s[68]++;t.true(_rec7._expr(_rec7._capt(_rec7._capt(_rec7._capt(AgentStub,'arguments/0/object/object').findById,'arguments/0/object').calledOnce,'arguments/0'),{content:'t.true(AgentStub.findById.calledOnce, \'findById debera ser llamada una vez\')',filepath:'tests\\agent-tests.js',line:127,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findById","range":[17,25]},"computed":false,"range":[7,25]},"property":{"type":"Identifier","name":"calledOnce","range":[26,36]},"computed":false,"range":[7,36]},{"type":"StringLiteral","value":"findById debera ser llamada una vez","range":[38,75]}],"range":[0,76]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findById","range":[17,25]},{"type":{"label":"."},"range":[25,26]},{"type":{"label":"name"},"value":"calledOnce","range":[26,36]},{"type":{"label":","},"range":[36,37]},{"type":{"label":"string"},"value":"findById debera ser llamada una vez","range":[38,75]},{"type":{"label":")"},"range":[75,76]}]',visitorKeys:_powerAssertVisitorKeys}),'findById debera ser llamada una vez');cov_18x8kxxxz6.s[69]++;t.true(_rec8._expr(_rec8._capt(_rec8._capt(_rec8._capt(AgentStub,'arguments/0/callee/object/object').findById,'arguments/0/callee/object').calledWith(_rec8._capt(id,'arguments/0/arguments/0')),'arguments/0'),{content:'t.true(AgentStub.findById.calledWith(id), \'findById debera llamar con los argumentos que son\')',filepath:'tests\\agent-tests.js',line:128,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findById","range":[17,25]},"computed":false,"range":[7,25]},"property":{"type":"Identifier","name":"calledWith","range":[26,36]},"computed":false,"range":[7,36]},"arguments":[{"type":"Identifier","name":"id","range":[37,39]}],"range":[7,40]},{"type":"StringLiteral","value":"findById debera llamar con los argumentos que son","range":[42,93]}],"range":[0,94]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findById","range":[17,25]},{"type":{"label":"."},"range":[25,26]},{"type":{"label":"name"},"value":"calledWith","range":[26,36]},{"type":{"label":"("},"range":[36,37]},{"type":{"label":"name"},"value":"id","range":[37,39]},{"type":{"label":")"},"range":[39,40]},{"type":{"label":","},"range":[40,41]},{"type":{"label":"string"},"value":"findById debera llamar con los argumentos que son","range":[42,93]},{"type":{"label":")"},"range":[93,94]}]',visitorKeys:_powerAssertVisitorKeys}),'findById debera llamar con los argumentos que son');cov_18x8kxxxz6.s[70]++;t.deepEqual(agent,agentFixtures.byId(id),'deberia ser el mismo');});// -----------------------------------------------------------------------
  cov_18x8kxxxz6.s[71]++;test.serial('Agent#findByUuid',async t=>{cov_18x8kxxxz6.f[13]++;var _rec9=(cov_18x8kxxxz6.s[72]++,new _powerAssertRecorder()),_rec10=(cov_18x8kxxxz6.s[73]++,new _powerAssertRecorder()),_rec11=(cov_18x8kxxxz6.s[74]++,new _powerAssertRecorder());let agent=(cov_18x8kxxxz6.s[75]++,await db.Agent.findByUuid(uuid));cov_18x8kxxxz6.s[76]++;t.true(_rec9._expr(_rec9._capt(_rec9._capt(_rec9._capt(AgentStub,'arguments/0/object/object').findOne,'arguments/0/object').called,'arguments/0'),{content:'t.true(AgentStub.findOne.called, \'findOne solo llamara al modelo\')',filepath:'tests\\agent-tests.js',line:136,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findOne solo llamara al modelo","range":[33,65]}],"range":[0,66]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findOne solo llamara al modelo","range":[33,65]},{"type":{"label":")"},"range":[65,66]}]',visitorKeys:_powerAssertVisitorKeys}),'findOne solo llamara al modelo');cov_18x8kxxxz6.s[77]++;t.true(_rec10._expr(_rec10._capt(_rec10._capt(_rec10._capt(AgentStub,'arguments/0/object/object').findOne,'arguments/0/object').calledOnce,'arguments/0'),{content:'t.true(AgentStub.findOne.calledOnce, \'findOne debera llamarse una sola vez\')',filepath:'tests\\agent-tests.js',line:137,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledOnce","range":[25,35]},"computed":false,"range":[7,35]},{"type":"StringLiteral","value":"findOne debera llamarse una sola vez","range":[37,75]}],"range":[0,76]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledOnce","range":[25,35]},{"type":{"label":","},"range":[35,36]},{"type":{"label":"string"},"value":"findOne debera llamarse una sola vez","range":[37,75]},{"type":{"label":")"},"range":[75,76]}]',visitorKeys:_powerAssertVisitorKeys}),'findOne debera llamarse una sola vez');cov_18x8kxxxz6.s[78]++;t.true(_rec11._expr(_rec11._capt(_rec11._capt(_rec11._capt(AgentStub,'arguments/0/callee/object/object').findOne,'arguments/0/callee/object').calledWith(_rec11._capt(uuidArgs,'arguments/0/arguments/0')),'arguments/0'),{content:'t.true(AgentStub.findOne.calledWith(uuidArgs), \'findOne debera llamar con argumentos\')',filepath:'tests\\agent-tests.js',line:138,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"uuidArgs","range":[36,44]}],"range":[7,45]},{"type":"StringLiteral","value":"findOne debera llamar con argumentos","range":[47,85]}],"range":[0,86]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"uuidArgs","range":[36,44]},{"type":{"label":")"},"range":[44,45]},{"type":{"label":","},"range":[45,46]},{"type":{"label":"string"},"value":"findOne debera llamar con argumentos","range":[47,85]},{"type":{"label":")"},"range":[85,86]}]',visitorKeys:_powerAssertVisitorKeys}),'findOne debera llamar con argumentos');cov_18x8kxxxz6.s[79]++;t.deepEqual(agent,agentFixtures.byUuid(uuid),'agent debera ser el mismo');});// ------------------------------------------------------------------------------
  cov_18x8kxxxz6.s[80]++;test.serial('Agent#findAll',async t=>{cov_18x8kxxxz6.f[14]++;var _rec12=(cov_18x8kxxxz6.s[81]++,new _powerAssertRecorder()),_rec13=(cov_18x8kxxxz6.s[82]++,new _powerAssertRecorder()),_rec14=(cov_18x8kxxxz6.s[83]++,new _powerAssertRecorder());let agents=(cov_18x8kxxxz6.s[84]++,await db.Agent.findAll());cov_18x8kxxxz6.s[85]++;t.true(_rec12._expr(_rec12._capt(_rec12._capt(_rec12._capt(AgentStub,'arguments/0/object/object').findAll,'arguments/0/object').called,'arguments/0'),{content:'t.true(AgentStub.findAll.called, \'findAll debera ser llamado\')',filepath:'tests\\agent-tests.js',line:146,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findAll debera ser llamado","range":[33,61]}],"range":[0,62]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findAll debera ser llamado","range":[33,61]},{"type":{"label":")"},"range":[61,62]}]',visitorKeys:_powerAssertVisitorKeys}),'findAll debera ser llamado');cov_18x8kxxxz6.s[86]++;t.true(_rec13._expr(_rec13._capt(_rec13._capt(_rec13._capt(AgentStub,'arguments/0/object/object').findAll,'arguments/0/object').calledOnce,'arguments/0'),{content:'t.true(AgentStub.findAll.calledOnce, \'findAll debera ser llamado una sola vez\')',filepath:'tests\\agent-tests.js',line:147,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledOnce","range":[25,35]},"computed":false,"range":[7,35]},{"type":"StringLiteral","value":"findAll debera ser llamado una sola vez","range":[37,78]}],"range":[0,79]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledOnce","range":[25,35]},{"type":{"label":","},"range":[35,36]},{"type":{"label":"string"},"value":"findAll debera ser llamado una sola vez","range":[37,78]},{"type":{"label":")"},"range":[78,79]}]',visitorKeys:_powerAssertVisitorKeys}),'findAll debera ser llamado una sola vez');cov_18x8kxxxz6.s[87]++;t.true(_rec14._expr(_rec14._capt(_rec14._capt(_rec14._capt(AgentStub,'arguments/0/callee/object/object').findAll,'arguments/0/callee/object').calledWith(),'arguments/0'),{content:'t.true(AgentStub.findAll.calledWith(), \'findAll debera ser llamado sin argumentos\')',filepath:'tests\\agent-tests.js',line:148,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[],"range":[7,37]},{"type":"StringLiteral","value":"findAll debera ser llamado sin argumentos","range":[39,82]}],"range":[0,83]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":")"},"range":[36,37]},{"type":{"label":","},"range":[37,38]},{"type":{"label":"string"},"value":"findAll debera ser llamado sin argumentos","range":[39,82]},{"type":{"label":")"},"range":[82,83]}]',visitorKeys:_powerAssertVisitorKeys}),'findAll debera ser llamado sin argumentos');cov_18x8kxxxz6.s[88]++;t.is(agents.length,agentFixtures.all.length,'agents deberan ser los mismos');cov_18x8kxxxz6.s[89]++;t.deepEqual(agents,agentFixtures.all,'agents deberan ser los mismos');});// --------------------------------------------------------------------
  cov_18x8kxxxz6.s[90]++;test.serial('Agent#findConnected',async t=>{cov_18x8kxxxz6.f[15]++;var _rec15=(cov_18x8kxxxz6.s[91]++,new _powerAssertRecorder()),_rec16=(cov_18x8kxxxz6.s[92]++,new _powerAssertRecorder()),_rec17=(cov_18x8kxxxz6.s[93]++,new _powerAssertRecorder());let agents=(cov_18x8kxxxz6.s[94]++,await db.Agent.findConnected());cov_18x8kxxxz6.s[95]++;t.true(_rec15._expr(_rec15._capt(_rec15._capt(_rec15._capt(AgentStub,'arguments/0/object/object').findAll,'arguments/0/object').called,'arguments/0'),{content:'t.true(AgentStub.findAll.called, \'findAll debera llamar al modelo\')',filepath:'tests\\agent-tests.js',line:157,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findAll debera llamar al modelo","range":[33,66]}],"range":[0,67]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findAll debera llamar al modelo","range":[33,66]},{"type":{"label":")"},"range":[66,67]}]',visitorKeys:_powerAssertVisitorKeys}),'findAll debera llamar al modelo');cov_18x8kxxxz6.s[96]++;t.true(_rec16._expr(_rec16._capt(_rec16._capt(_rec16._capt(AgentStub,'arguments/0/object/object').findAll,'arguments/0/object').calledOnce,'arguments/0'),{content:'t.true(AgentStub.findAll.calledOnce, \'findAll debera ser llamado una sola vez\')',filepath:'tests\\agent-tests.js',line:158,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledOnce","range":[25,35]},"computed":false,"range":[7,35]},{"type":"StringLiteral","value":"findAll debera ser llamado una sola vez","range":[37,78]}],"range":[0,79]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledOnce","range":[25,35]},{"type":{"label":","},"range":[35,36]},{"type":{"label":"string"},"value":"findAll debera ser llamado una sola vez","range":[37,78]},{"type":{"label":")"},"range":[78,79]}]',visitorKeys:_powerAssertVisitorKeys}),'findAll debera ser llamado una sola vez');cov_18x8kxxxz6.s[97]++;t.true(_rec17._expr(_rec17._capt(_rec17._capt(_rec17._capt(AgentStub,'arguments/0/callee/object/object').findAll,'arguments/0/callee/object').calledWith(_rec17._capt(connectedArgs,'arguments/0/arguments/0')),'arguments/0'),{content:'t.true(AgentStub.findAll.calledWith(connectedArgs), \'findAll debera ser llamado con argumentos\')',filepath:'tests\\agent-tests.js',line:159,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"connectedArgs","range":[36,49]}],"range":[7,50]},{"type":"StringLiteral","value":"findAll debera ser llamado con argumentos","range":[52,95]}],"range":[0,96]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"connectedArgs","range":[36,49]},{"type":{"label":")"},"range":[49,50]},{"type":{"label":","},"range":[50,51]},{"type":{"label":"string"},"value":"findAll debera ser llamado con argumentos","range":[52,95]},{"type":{"label":")"},"range":[95,96]}]',visitorKeys:_powerAssertVisitorKeys}),'findAll debera ser llamado con argumentos');cov_18x8kxxxz6.s[98]++;t.is(agents.length,agentFixtures.connected.length,'agents deberanser llamado');cov_18x8kxxxz6.s[99]++;t.deepEqual(agents,agentFixtures.connected,'agents debera ser el mismo');});// -------------------------------------------------------------
  cov_18x8kxxxz6.s[100]++;test.serial('Agent#findByUsername',async t=>{cov_18x8kxxxz6.f[16]++;var _rec18=(cov_18x8kxxxz6.s[101]++,new _powerAssertRecorder()),_rec19=(cov_18x8kxxxz6.s[102]++,new _powerAssertRecorder()),_rec20=(cov_18x8kxxxz6.s[103]++,new _powerAssertRecorder());let agents=(cov_18x8kxxxz6.s[104]++,await db.Agent.findByUsername('iot'));cov_18x8kxxxz6.s[105]++;t.true(_rec18._expr(_rec18._capt(_rec18._capt(_rec18._capt(AgentStub,'arguments/0/object/object').findAll,'arguments/0/object').called,'arguments/0'),{content:'t.true(AgentStub.findAll.called, \'findAll debera llamar el modelo\')',filepath:'tests\\agent-tests.js',line:169,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findAll debera llamar el modelo","range":[33,66]}],"range":[0,67]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findAll debera llamar el modelo","range":[33,66]},{"type":{"label":")"},"range":[66,67]}]',visitorKeys:_powerAssertVisitorKeys}),'findAll debera llamar el modelo');cov_18x8kxxxz6.s[106]++;t.true(_rec19._expr(_rec19._capt(_rec19._capt(_rec19._capt(AgentStub,'arguments/0/object/object').findAll,'arguments/0/object').calledOnce,'arguments/0'),{content:'t.true(AgentStub.findAll.calledOnce, \'findAll debera ser llamado una sola vez\')',filepath:'tests\\agent-tests.js',line:170,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledOnce","range":[25,35]},"computed":false,"range":[7,35]},{"type":"StringLiteral","value":"findAll debera ser llamado una sola vez","range":[37,78]}],"range":[0,79]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledOnce","range":[25,35]},{"type":{"label":","},"range":[35,36]},{"type":{"label":"string"},"value":"findAll debera ser llamado una sola vez","range":[37,78]},{"type":{"label":")"},"range":[78,79]}]',visitorKeys:_powerAssertVisitorKeys}),'findAll debera ser llamado una sola vez');cov_18x8kxxxz6.s[107]++;t.true(_rec20._expr(_rec20._capt(_rec20._capt(_rec20._capt(AgentStub,'arguments/0/callee/object/object').findAll,'arguments/0/callee/object').calledWith(_rec20._capt(usernameArgs,'arguments/0/arguments/0')),'arguments/0'),{content:'t.true(AgentStub.findAll.calledWith(usernameArgs), \'findAll debera ser llamado con argumentos\')',filepath:'tests\\agent-tests.js',line:171,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findAll","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"usernameArgs","range":[36,48]}],"range":[7,49]},{"type":"StringLiteral","value":"findAll debera ser llamado con argumentos","range":[51,94]}],"range":[0,95]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findAll","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"usernameArgs","range":[36,48]},{"type":{"label":")"},"range":[48,49]},{"type":{"label":","},"range":[49,50]},{"type":{"label":"string"},"value":"findAll debera ser llamado con argumentos","range":[51,94]},{"type":{"label":")"},"range":[94,95]}]',visitorKeys:_powerAssertVisitorKeys}),'findAll debera ser llamado con argumentos');cov_18x8kxxxz6.s[108]++;t.is(agents.length,agentFixtures.iot.length,'agents deneran ser los mismos');cov_18x8kxxxz6.s[109]++;t.deepEqual(agents,agentFixtures.iot,'agents deberan ser los mismos');});// ---------------------------------------------------
  cov_18x8kxxxz6.s[110]++;test.serial('Agent#createOrUpdate - exists',async t=>{cov_18x8kxxxz6.f[17]++;var _rec21=(cov_18x8kxxxz6.s[111]++,new _powerAssertRecorder()),_rec22=(cov_18x8kxxxz6.s[112]++,new _powerAssertRecorder()),_rec23=(cov_18x8kxxxz6.s[113]++,new _powerAssertRecorder()),_rec24=(cov_18x8kxxxz6.s[114]++,new _powerAssertRecorder()),_rec25=(cov_18x8kxxxz6.s[115]++,new _powerAssertRecorder()),_rec26=(cov_18x8kxxxz6.s[116]++,new _powerAssertRecorder());let agent=(cov_18x8kxxxz6.s[117]++,await db.Agent.createOrUpdate(single));cov_18x8kxxxz6.s[118]++;t.true(_rec21._expr(_rec21._capt(_rec21._capt(_rec21._capt(AgentStub,'arguments/0/object/object').findOne,'arguments/0/object').called,'arguments/0'),{content:'t.true(AgentStub.findOne.called, \'findOne debera llamar al modelo\')',filepath:'tests\\agent-tests.js',line:180,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"called","range":[25,31]},"computed":false,"range":[7,31]},{"type":"StringLiteral","value":"findOne debera llamar al modelo","range":[33,66]}],"range":[0,67]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"called","range":[25,31]},{"type":{"label":","},"range":[31,32]},{"type":{"label":"string"},"value":"findOne debera llamar al modelo","range":[33,66]},{"type":{"label":")"},"range":[66,67]}]',visitorKeys:_powerAssertVisitorKeys}),'findOne debera llamar al modelo');cov_18x8kxxxz6.s[119]++;t.true(_rec22._expr(_rec22._capt(_rec22._capt(_rec22._capt(AgentStub,'arguments/0/object/object').findOne,'arguments/0/object').calledTwice,'arguments/0'),{content:'t.true(AgentStub.findOne.calledTwice, \'findOne debera llamar dos veces\')',filepath:'tests\\agent-tests.js',line:181,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledTwice","range":[25,36]},"computed":false,"range":[7,36]},{"type":"StringLiteral","value":"findOne debera llamar dos veces","range":[38,71]}],"range":[0,72]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledTwice","range":[25,36]},{"type":{"label":","},"range":[36,37]},{"type":{"label":"string"},"value":"findOne debera llamar dos veces","range":[38,71]},{"type":{"label":")"},"range":[71,72]}]',visitorKeys:_powerAssertVisitorKeys}),'findOne debera llamar dos veces');cov_18x8kxxxz6.s[120]++;t.true(_rec23._expr(_rec23._capt(_rec23._capt(_rec23._capt(AgentStub,'arguments/0/callee/object/object').findOne,'arguments/0/callee/object').calledWith(_rec23._capt(uuidArgs,'arguments/0/arguments/0')),'arguments/0'),{content:'t.true(AgentStub.findOne.calledWith(uuidArgs), \'findOne debe ser llamado con argumentos\')',filepath:'tests\\agent-tests.js',line:182,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"findOne","range":[17,24]},"computed":false,"range":[7,24]},"property":{"type":"Identifier","name":"calledWith","range":[25,35]},"computed":false,"range":[7,35]},"arguments":[{"type":"Identifier","name":"uuidArgs","range":[36,44]}],"range":[7,45]},{"type":"StringLiteral","value":"findOne debe ser llamado con argumentos","range":[47,88]}],"range":[0,89]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"findOne","range":[17,24]},{"type":{"label":"."},"range":[24,25]},{"type":{"label":"name"},"value":"calledWith","range":[25,35]},{"type":{"label":"("},"range":[35,36]},{"type":{"label":"name"},"value":"uuidArgs","range":[36,44]},{"type":{"label":")"},"range":[44,45]},{"type":{"label":","},"range":[45,46]},{"type":{"label":"string"},"value":"findOne debe ser llamado con argumentos","range":[47,88]},{"type":{"label":")"},"range":[88,89]}]',visitorKeys:_powerAssertVisitorKeys}),'findOne debe ser llamado con argumentos');cov_18x8kxxxz6.s[121]++;t.true(_rec24._expr(_rec24._capt(_rec24._capt(_rec24._capt(AgentStub,'arguments/0/object/object').update,'arguments/0/object').called,'arguments/0'),{content:'t.true(AgentStub.update.called, \'agent.update llama un modelo\')',filepath:'tests\\agent-tests.js',line:183,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"update","range":[17,23]},"computed":false,"range":[7,23]},"property":{"type":"Identifier","name":"called","range":[24,30]},"computed":false,"range":[7,30]},{"type":"StringLiteral","value":"agent.update llama un modelo","range":[32,62]}],"range":[0,63]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"update","range":[17,23]},{"type":{"label":"."},"range":[23,24]},{"type":{"label":"name"},"value":"called","range":[24,30]},{"type":{"label":","},"range":[30,31]},{"type":{"label":"string"},"value":"agent.update llama un modelo","range":[32,62]},{"type":{"label":")"},"range":[62,63]}]',visitorKeys:_powerAssertVisitorKeys}),'agent.update llama un modelo');cov_18x8kxxxz6.s[122]++;t.true(_rec25._expr(_rec25._capt(_rec25._capt(_rec25._capt(AgentStub,'arguments/0/object/object').update,'arguments/0/object').calledOnce,'arguments/0'),{content:'t.true(AgentStub.update.calledOnce, \'update debera ser llamado una sola vez\')',filepath:'tests\\agent-tests.js',line:184,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"update","range":[17,23]},"computed":false,"range":[7,23]},"property":{"type":"Identifier","name":"calledOnce","range":[24,34]},"computed":false,"range":[7,34]},{"type":"StringLiteral","value":"update debera ser llamado una sola vez","range":[36,76]}],"range":[0,77]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"update","range":[17,23]},{"type":{"label":"."},"range":[23,24]},{"type":{"label":"name"},"value":"calledOnce","range":[24,34]},{"type":{"label":","},"range":[34,35]},{"type":{"label":"string"},"value":"update debera ser llamado una sola vez","range":[36,76]},{"type":{"label":")"},"range":[76,77]}]',visitorKeys:_powerAssertVisitorKeys}),'update debera ser llamado una sola vez');cov_18x8kxxxz6.s[123]++;t.true(_rec26._expr(_rec26._capt(_rec26._capt(_rec26._capt(AgentStub,'arguments/0/callee/object/object').update,'arguments/0/callee/object').calledWith(_rec26._capt(single,'arguments/0/arguments/0')),'arguments/0'),{content:'t.true(AgentStub.update.calledWith(single), \'agent.update debera ser llamado singularmente\')',filepath:'tests\\agent-tests.js',line:185,async:true,ast:'{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"t","range":[0,1]},"property":{"type":"Identifier","name":"true","range":[2,6]},"computed":false,"range":[0,6]},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"AgentStub","range":[7,16]},"property":{"type":"Identifier","name":"update","range":[17,23]},"computed":false,"range":[7,23]},"property":{"type":"Identifier","name":"calledWith","range":[24,34]},"computed":false,"range":[7,34]},"arguments":[{"type":"Identifier","name":"single","range":[35,41]}],"range":[7,42]},{"type":"StringLiteral","value":"agent.update debera ser llamado singularmente","range":[44,91]}],"range":[0,92]}',tokens:'[{"type":{"label":"name"},"value":"t","range":[0,1]},{"type":{"label":"."},"range":[1,2]},{"type":{"label":"true"},"value":"true","range":[2,6]},{"type":{"label":"("},"range":[6,7]},{"type":{"label":"name"},"value":"AgentStub","range":[7,16]},{"type":{"label":"."},"range":[16,17]},{"type":{"label":"name"},"value":"update","range":[17,23]},{"type":{"label":"."},"range":[23,24]},{"type":{"label":"name"},"value":"calledWith","range":[24,34]},{"type":{"label":"("},"range":[34,35]},{"type":{"label":"name"},"value":"single","range":[35,41]},{"type":{"label":")"},"range":[41,42]},{"type":{"label":","},"range":[42,43]},{"type":{"label":"string"},"value":"agent.update debera ser llamado singularmente","range":[44,91]},{"type":{"label":")"},"range":[91,92]}]',visitorKeys:_powerAssertVisitorKeys}),'agent.update debera ser llamado singularmente');cov_18x8kxxxz6.s[124]++;t.deepEqual(agent,single,'el agent deberia ser el mismo');});// ------------------------------------------------------------
  cov_18x8kxxxz6.s[125]++;test.serial('Agent#createOrUpdate - new',async t=>{cov_18x8kxxxz6.f[18]++;let agent=(cov_18x8kxxxz6.s[126]++,await db.Agent.createOrUpdate(newAgent));//t.true(AgentStub.findOne.called, 'findOne debera llamar una vez al objeto')
  //t.true(AgentStub.findOne.calledOnce, 'findOne debera llamar una vez')
  //t.true(AgentStub.findOne.calledWith({
  // where: { uuid: newAgent.uuid }
  // }), 'findOne debera llamar los argumentos de uuid args')
  //t.true(AgentStub.create.called, 'create debera llamar un modelo')
  //t.true(AgentStub.create.calledOnce, 'create debera llamarse una vez')
  //t.true(AgentStub.create.calledWith(newAgent), 'create debera llamarse con argumentos')
  cov_18x8kxxxz6.s[127]++;t.deepEqual(agent.newAgent,'agent debera llamarse solo');});// ---------------------------------------------------------------------
  //# sourceMappingURL=C:\Users\Angel Barusta\Desktop\nodejs\iot_nodejs\node_modules\.cache\ava\51d2829a6207b891b7e0442d474f635a.js.map