item.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. var request = require("request");
  2. var qs = require("querystring");
  3. var uuid = require("uuid");
  4. var should = require("should");
  5. var sinon = require("sinon");
  6. var url = require("url");
  7. var ua = require("../lib/index.js");
  8. var utils = require("../lib/utils.js")
  9. var config = require("../lib/config.js")
  10. describe("ua", function () {
  11. describe("#item", function () {
  12. var _enqueue;
  13. beforeEach(function () {
  14. _enqueue = sinon.stub(ua.Visitor.prototype, "_enqueue", function (type, params, fn) {
  15. if (fn) {
  16. (typeof fn).should.equal('function', "#_enqueue should receive a callback")
  17. fn();
  18. }
  19. return this;
  20. });
  21. });
  22. afterEach(function () {
  23. _enqueue.restore()
  24. });
  25. it("should be available via the #i shortcut", function () {
  26. var visitor = ua()
  27. visitor.i.should.equal(visitor.item)
  28. });
  29. it("should accept arguments (price) when chained to transaction", function () {
  30. var transaction = Math.random().toString();
  31. var price = Math.random();
  32. var visitor = ua().transaction(transaction);
  33. var result = visitor.item(price);
  34. visitor._context = result._context;
  35. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  36. result.should.be.instanceof(ua.Visitor);
  37. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  38. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  39. _enqueue.args[0][0].should.equal("transaction");
  40. _enqueue.args[1][0].should.equal("item");
  41. _enqueue.args[1][1].should.have.keys("ti", "ip")
  42. _enqueue.args[1][1].ti.should.equal(transaction);
  43. _enqueue.args[1][1].ip.should.equal(price);
  44. });
  45. it("should accept arguments (price, fn) when chained to transaction", function () {
  46. var transaction = Math.random().toString();
  47. var price = Math.random();
  48. var fn = sinon.spy()
  49. var visitor = ua().transaction(transaction);
  50. var result = visitor.item(price, fn);
  51. visitor._context = result._context;
  52. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  53. result.should.be.instanceof(ua.Visitor);
  54. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  55. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  56. _enqueue.args[0][0].should.equal("transaction");
  57. _enqueue.args[1][0].should.equal("item");
  58. _enqueue.args[1][1].should.have.keys("ti", "ip")
  59. _enqueue.args[1][1].ti.should.equal(transaction);
  60. _enqueue.args[1][1].ip.should.equal(price);
  61. fn.calledOnce.should.equal(true, "callback should have been called once")
  62. });
  63. it("should accept arguments (price, quantity) when chained to transaction", function () {
  64. var transaction = Math.random().toString();
  65. var price = Math.random();
  66. var quantity = Math.random();
  67. var visitor = ua().transaction(transaction);
  68. var result = visitor.item(price, quantity);
  69. visitor._context = result._context;
  70. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  71. result.should.be.instanceof(ua.Visitor);
  72. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  73. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  74. _enqueue.args[0][0].should.equal("transaction");
  75. _enqueue.args[1][0].should.equal("item");
  76. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq")
  77. _enqueue.args[1][1].ti.should.equal(transaction);
  78. _enqueue.args[1][1].ip.should.equal(price);
  79. _enqueue.args[1][1].iq.should.equal(quantity);
  80. });
  81. it("should accept arguments (price, quantity, fn) when chained to transaction", function () {
  82. var transaction = Math.random().toString();
  83. var price = Math.random();
  84. var quantity = Math.random();
  85. var fn = sinon.spy()
  86. var visitor = ua().transaction(transaction);
  87. var result = visitor.item(price, quantity, fn);
  88. visitor._context = result._context;
  89. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  90. result.should.be.instanceof(ua.Visitor);
  91. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  92. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  93. _enqueue.args[0][0].should.equal("transaction");
  94. _enqueue.args[1][0].should.equal("item");
  95. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq")
  96. _enqueue.args[1][1].ti.should.equal(transaction);
  97. _enqueue.args[1][1].ip.should.equal(price);
  98. _enqueue.args[1][1].iq.should.equal(quantity);
  99. fn.calledOnce.should.equal(true, "callback should have been called once")
  100. });
  101. it("should accept arguments (price, quantity, sku) when chained to transaction", function () {
  102. var transaction = Math.random().toString();
  103. var price = Math.random();
  104. var quantity = Math.random();
  105. var sku = Math.random().toString();
  106. var visitor = ua().transaction(transaction);
  107. var result = visitor.item(price, quantity, sku);
  108. visitor._context = result._context;
  109. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  110. result.should.be.instanceof(ua.Visitor);
  111. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  112. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  113. _enqueue.args[0][0].should.equal("transaction");
  114. _enqueue.args[1][0].should.equal("item");
  115. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq", "ic")
  116. _enqueue.args[1][1].ti.should.equal(transaction);
  117. _enqueue.args[1][1].ip.should.equal(price);
  118. _enqueue.args[1][1].iq.should.equal(quantity);
  119. _enqueue.args[1][1].ic.should.equal(sku);
  120. });
  121. it("should accept arguments (price, quantity, sku, fn) when chained to transaction", function () {
  122. var transaction = Math.random().toString();
  123. var price = Math.random();
  124. var quantity = Math.random();
  125. var sku = Math.random().toString();
  126. var fn = sinon.spy()
  127. var visitor = ua().transaction(transaction);
  128. var result = visitor.item(price, quantity, sku, fn);
  129. visitor._context = result._context;
  130. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  131. result.should.be.instanceof(ua.Visitor);
  132. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  133. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  134. _enqueue.args[0][0].should.equal("transaction");
  135. _enqueue.args[1][0].should.equal("item");
  136. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq", "ic")
  137. _enqueue.args[1][1].ti.should.equal(transaction);
  138. _enqueue.args[1][1].ip.should.equal(price);
  139. _enqueue.args[1][1].iq.should.equal(quantity);
  140. _enqueue.args[1][1].ic.should.equal(sku);
  141. fn.calledOnce.should.equal(true, "callback should have been called once")
  142. });
  143. it("should accept arguments (price, quantity, sku, name) when chained to transaction", function () {
  144. var transaction = Math.random().toString();
  145. var price = Math.random();
  146. var quantity = Math.random();
  147. var sku = Math.random().toString();
  148. var name = Math.random().toString();
  149. var visitor = ua().transaction(transaction);
  150. var result = visitor.item(price, quantity, sku, name);
  151. visitor._context = result._context;
  152. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  153. result.should.be.instanceof(ua.Visitor);
  154. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  155. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  156. _enqueue.args[0][0].should.equal("transaction");
  157. _enqueue.args[1][0].should.equal("item");
  158. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq", "ic", "in")
  159. _enqueue.args[1][1].ti.should.equal(transaction);
  160. _enqueue.args[1][1].ip.should.equal(price);
  161. _enqueue.args[1][1].iq.should.equal(quantity);
  162. _enqueue.args[1][1].ic.should.equal(sku);
  163. _enqueue.args[1][1].in.should.equal(name);
  164. });
  165. it("should accept arguments (price, quantity, sku, name, fn) when chained to transaction", function () {
  166. var transaction = Math.random().toString();
  167. var price = Math.random();
  168. var quantity = Math.random();
  169. var sku = Math.random().toString();
  170. var name = Math.random().toString();
  171. var fn = sinon.spy()
  172. var visitor = ua().transaction(transaction);
  173. var result = visitor.item(price, quantity, sku, name, fn);
  174. visitor._context = result._context;
  175. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  176. result.should.be.instanceof(ua.Visitor);
  177. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  178. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  179. _enqueue.args[0][0].should.equal("transaction");
  180. _enqueue.args[1][0].should.equal("item");
  181. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq", "ic", "in")
  182. _enqueue.args[1][1].ti.should.equal(transaction);
  183. _enqueue.args[1][1].ip.should.equal(price);
  184. _enqueue.args[1][1].iq.should.equal(quantity);
  185. _enqueue.args[1][1].ic.should.equal(sku);
  186. _enqueue.args[1][1].in.should.equal(name);
  187. fn.calledOnce.should.equal(true, "callback should have been called once")
  188. });
  189. it("should accept arguments (price, quantity, sku, name, variation) when chained to transaction", function () {
  190. var transaction = Math.random().toString();
  191. var price = Math.random();
  192. var quantity = Math.random();
  193. var sku = Math.random().toString();
  194. var name = Math.random().toString();
  195. var variation = Math.random().toString();
  196. var visitor = ua().transaction(transaction);
  197. var result = visitor.item(price, quantity, sku, name, variation);
  198. visitor._context = result._context;
  199. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  200. result.should.be.instanceof(ua.Visitor);
  201. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  202. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  203. _enqueue.args[0][0].should.equal("transaction");
  204. _enqueue.args[1][0].should.equal("item");
  205. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq", "ic", "in", "iv")
  206. _enqueue.args[1][1].ti.should.equal(transaction);
  207. _enqueue.args[1][1].ip.should.equal(price);
  208. _enqueue.args[1][1].iq.should.equal(quantity);
  209. _enqueue.args[1][1].ic.should.equal(sku);
  210. _enqueue.args[1][1].in.should.equal(name);
  211. _enqueue.args[1][1].iv.should.equal(variation);
  212. });
  213. it("should accept arguments (price, quantity, sku, name, variation, fn) when chained to transaction", function () {
  214. var transaction = Math.random().toString();
  215. var price = Math.random();
  216. var quantity = Math.random();
  217. var sku = Math.random().toString();
  218. var name = Math.random().toString();
  219. var variation = Math.random().toString();
  220. var fn = sinon.spy()
  221. var visitor = ua().transaction(transaction);
  222. var result = visitor.item(price, quantity, sku, name, variation, fn);
  223. visitor._context = result._context;
  224. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  225. result.should.be.instanceof(ua.Visitor);
  226. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  227. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  228. _enqueue.args[0][0].should.equal("transaction");
  229. _enqueue.args[1][0].should.equal("item");
  230. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq", "ic", "in", "iv")
  231. _enqueue.args[1][1].ti.should.equal(transaction);
  232. _enqueue.args[1][1].ip.should.equal(price);
  233. _enqueue.args[1][1].iq.should.equal(quantity);
  234. _enqueue.args[1][1].ic.should.equal(sku);
  235. _enqueue.args[1][1].in.should.equal(name);
  236. _enqueue.args[1][1].iv.should.equal(variation);
  237. fn.calledOnce.should.equal(true, "callback should have been called once")
  238. });
  239. it("should accept arguments (price, quantity, sku, name, variation, params) when chained to transaction", function () {
  240. var transaction = Math.random().toString();
  241. var price = Math.random();
  242. var quantity = Math.random();
  243. var sku = Math.random().toString();
  244. var name = Math.random().toString();
  245. var variation = Math.random().toString();
  246. var params = {foo: Math.random().toString()};
  247. var visitor = ua().transaction(transaction);
  248. var result = visitor.item(price, quantity, sku, name, variation, params);
  249. visitor._context = result._context;
  250. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  251. result.should.be.instanceof(ua.Visitor);
  252. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  253. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  254. _enqueue.args[0][0].should.equal("transaction");
  255. _enqueue.args[1][0].should.equal("item");
  256. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq", "ic", "in", "iv", "foo")
  257. _enqueue.args[1][1].ti.should.equal(transaction);
  258. _enqueue.args[1][1].ip.should.equal(price);
  259. _enqueue.args[1][1].iq.should.equal(quantity);
  260. _enqueue.args[1][1].ic.should.equal(sku);
  261. _enqueue.args[1][1].in.should.equal(name);
  262. _enqueue.args[1][1].iv.should.equal(variation);
  263. _enqueue.args[1][1].foo.should.equal(params.foo);
  264. });
  265. it("should accept arguments (price, quantity, sku, name, variation, params, fn) when chained to transaction", function () {
  266. var transaction = Math.random().toString();
  267. var price = Math.random();
  268. var quantity = Math.random();
  269. var sku = Math.random().toString();
  270. var name = Math.random().toString();
  271. var variation = Math.random().toString();
  272. var params = {foo: Math.random().toString()};
  273. var fn = sinon.spy()
  274. var visitor = ua().transaction(transaction);
  275. var result = visitor.item(price, quantity, sku, name, variation, params, fn);
  276. visitor._context = result._context;
  277. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  278. result.should.be.instanceof(ua.Visitor);
  279. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  280. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction before");
  281. _enqueue.args[0][0].should.equal("transaction");
  282. _enqueue.args[1][0].should.equal("item");
  283. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq", "ic", "in", "iv", "foo")
  284. _enqueue.args[1][1].ti.should.equal(transaction);
  285. _enqueue.args[1][1].ip.should.equal(price);
  286. _enqueue.args[1][1].iq.should.equal(quantity);
  287. _enqueue.args[1][1].ic.should.equal(sku);
  288. _enqueue.args[1][1].in.should.equal(name);
  289. _enqueue.args[1][1].iv.should.equal(variation);
  290. _enqueue.args[1][1].foo.should.equal(params.foo);
  291. fn.calledOnce.should.equal(true, "callback should have been called once")
  292. });
  293. it("should accept arguments (price, quantity, sku, name, variation, params, fn) when params include transaction", function () {
  294. var price = Math.random();
  295. var quantity = Math.random();
  296. var sku = Math.random().toString();
  297. var name = Math.random().toString();
  298. var variation = Math.random().toString();
  299. var params = {ti: Math.random()};
  300. var fn = sinon.spy()
  301. var visitor = ua();
  302. var result = visitor.item(price, quantity, sku, name, variation, params, fn);
  303. visitor._context = result._context;
  304. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  305. result.should.be.instanceof(ua.Visitor);
  306. result._context.should.eql(_enqueue.args[0][1], "the transaction params should be persisted as the context of the visitor clone")
  307. _enqueue.calledOnce.should.equal(true, "#_enqueue should have been called once");
  308. _enqueue.args[0][0].should.equal("item");
  309. _enqueue.args[0][1].should.have.keys("ti", "ip", "iq", "ic", "in", "iv")
  310. _enqueue.args[0][1].ip.should.equal(price);
  311. _enqueue.args[0][1].iq.should.equal(quantity);
  312. _enqueue.args[0][1].ic.should.equal(sku);
  313. _enqueue.args[0][1].in.should.equal(name);
  314. _enqueue.args[0][1].iv.should.equal(variation);
  315. _enqueue.args[0][1].ti.should.equal(params.ti);
  316. fn.calledOnce.should.equal(true, "callback should have been called once")
  317. });
  318. it("should accept arguments (params, fn) when params include transaction", function () {
  319. var params = {
  320. ip: Math.random(),
  321. iq: Math.random(),
  322. ic: Math.random().toString(),
  323. in: Math.random().toString(),
  324. iv: Math.random().toString(),
  325. ti: Math.random()
  326. };
  327. var fn = sinon.spy()
  328. var visitor = ua();
  329. var result = visitor.item(params, fn);
  330. visitor._context = result._context;
  331. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  332. result.should.be.instanceof(ua.Visitor);
  333. result._context.should.eql(_enqueue.args[0][1], "the transaction params should be persisted as the context of the visitor clone")
  334. _enqueue.calledOnce.should.equal(true, "#_enqueue should have been called once");
  335. _enqueue.args[0][0].should.equal("item");
  336. _enqueue.args[0][1].should.have.keys("ti", "ip", "iq", "ic", "in", "iv")
  337. _enqueue.args[0][1].ip.should.equal(params.ip);
  338. _enqueue.args[0][1].iq.should.equal(params.iq);
  339. _enqueue.args[0][1].ic.should.equal(params.ic);
  340. _enqueue.args[0][1].in.should.equal(params.in);
  341. _enqueue.args[0][1].iv.should.equal(params.iv);
  342. _enqueue.args[0][1].ti.should.equal(params.ti);
  343. fn.calledOnce.should.equal(true, "callback should have been called once")
  344. });
  345. it("should accept arguments (params, fn) when chained to a transaction", function () {
  346. var transaction = Math.random().toString();
  347. var params = {
  348. ip: Math.random(),
  349. iq: Math.random(),
  350. ic: Math.random().toString(),
  351. in: Math.random().toString(),
  352. iv: Math.random().toString()
  353. };
  354. var fn = sinon.spy()
  355. var visitor = ua().transaction(transaction);
  356. var result = visitor.item(params, fn);
  357. visitor._context = result._context;
  358. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  359. result.should.be.instanceof(ua.Visitor);
  360. result._context.should.eql(_enqueue.args[1][1], "the transaction params should be persisted as the context of the visitor clone")
  361. _enqueue.calledTwice.should.equal(true, "#_enqueue should have been called twice, once for the transaction");
  362. _enqueue.args[1][0].should.equal("item");
  363. _enqueue.args[1][1].should.have.keys("ti", "ip", "iq", "ic", "in", "iv")
  364. _enqueue.args[1][1].ip.should.equal(params.ip);
  365. _enqueue.args[1][1].iq.should.equal(params.iq);
  366. _enqueue.args[1][1].ic.should.equal(params.ic);
  367. _enqueue.args[1][1].in.should.equal(params.in);
  368. _enqueue.args[1][1].iv.should.equal(params.iv);
  369. _enqueue.args[1][1].ti.should.equal(transaction);
  370. fn.calledOnce.should.equal(true, "callback should have been called once")
  371. });
  372. it("should allow daisy-chaining to re-use arguments", function () {
  373. var transaction = Math.random().toString();
  374. var price = Math.random();
  375. var quantity = Math.random();
  376. var sku = Math.random().toString();
  377. var name = Math.random().toString();
  378. var name2 = Math.random().toString();
  379. var variation = Math.random().toString();
  380. var fn = sinon.spy()
  381. var visitor = ua().transaction(transaction);
  382. var result = visitor.item(price, quantity, sku, name, variation).item({in: name2}, fn);
  383. _enqueue.calledThrice.should.equal(true, "#_enqueue should have been called thrice, once for the transaction before");
  384. _enqueue.args[0][0].should.equal("transaction");
  385. _enqueue.args[1][0].should.equal(_enqueue.args[2][0]);
  386. _enqueue.args[1][1].ti.should.equal(_enqueue.args[2][1].ti, "ti should be equal on both");
  387. _enqueue.args[1][1].ip.should.equal(_enqueue.args[2][1].ip, "ip should be equal on both");
  388. _enqueue.args[1][1].iq.should.equal(_enqueue.args[2][1].iq, "iq should be equal on both");
  389. _enqueue.args[1][1].ic.should.equal(_enqueue.args[2][1].ic, "ic should be equal on both");
  390. _enqueue.args[1][1].iv.should.equal(_enqueue.args[2][1].iv, "iv should be equal on both");
  391. _enqueue.args[2][1].in.should.equal(name2, "name should have changed on second item");
  392. fn.calledOnce.should.equal(true, "callback should have been called once")
  393. });
  394. it("should fail without transaction ID", function () {
  395. var params = {
  396. ip: Math.random(),
  397. iq: Math.random(),
  398. ic: Math.random().toString(),
  399. in: Math.random().toString(),
  400. iv: Math.random().toString()
  401. };
  402. var fn = sinon.spy()
  403. var visitor = ua();
  404. var result = visitor.item(params, fn);
  405. visitor._context = result._context;
  406. result.should.eql(visitor, "should return a visitor that is identical except for the context");
  407. result.should.be.instanceof(ua.Visitor);
  408. result._context.should.eql({}, "the transaction params should not be persisted")
  409. _enqueue.called.should.equal(false, "#_enqueue should have not been called once");
  410. fn.calledOnce.should.equal(true, "callback should have been called once");
  411. fn.args[0][0].should.be.instanceof(Error);
  412. fn.thisValues[0].should.equal(visitor);
  413. });
  414. });
  415. });