{ "id": "155717", "key": "TIMOB-20603", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-12-12T20:25:54.000+0000", "created": "2016-03-14T14:09:11.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-12-12T20:25:54.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "Hi,\r\n\r\nI tried to utilise ti.mocha in our application.\r\nIt works with the very basic example.\r\n\r\nBut as suggested by tonylukasavage, we are trying on consume should.js for assertion.\r\nBut it's throwing error always.\r\n\r\nIn one of the comments from the blog its mention that we have to use only the should.js file and not the complete SDK.\r\nhttp://tonylukasavage.com/blog/2014/01/13/ti-mocha-mocha-testing-support-for-titanium/\r\n\r\nPlease look into in this and let us know asap.\r\n\r\nPFB error logs for the same.\r\n\r\n Script Error {\r\n[ERROR] : column = 15;\r\n[ERROR] : line = 26;\r\n[ERROR] : message = \"Can't find variable: window\";\r\n[ERROR] : sourceURL = \"file:///Users/Nikesh/Library/Developer/CoreSimulator/Devices/1B9238A9-7066-4BE5-9CA7-177D26014FC2/data/Containers/Bundle/Application/72590E8D-686D-4932-B2FE-113A5FD68245/behaveExample.app/should.js\";\r\n[ERROR] : stack = \"file:///Users/Nikesh/Library/Developer/CoreSimulator/Devices/1B9238A9-7066-4BE5-9CA7-177D26014FC2/data/Containers/Bundle/Application/72590E8D-686D-4932-B2FE-113A5FD68245/behaveExample.app/should.js:26:15\\ns@file:///Users/Nikesh/Library/Developer/CoreSimulator/Devices/1B9238A9-7066-4BE5-9CA7-177D26014FC2/data/Containers/Bundle/Application/72590E8D-686D-4932-B2FE-113A5FD68245/behaveExample.app/should.js:14:25\\ne@file:///Users/Nikesh/Library/Developer/CoreSimulator/Devices/1B9238A9-7066-4BE5-9CA7-177D26014FC2/data/Containers/Bundle/Application/72590E8D-686D-4932-B2FE-113A5FD68245/behaveExample.app/should.js:22:41\\nfile:///Users/Nikesh/Library/Developer/CoreSimulator/Devices/1B9238A9-7066-4BE5-9CA7-177D26014FC2/data/Containers/Bundle/Application/72590E8D-686D-4932-B2FE-113A5FD68245/behaveExample.app/should.js:24:2\\nglobal code@file:///Users/Nikesh/Library/Developer/CoreSimulator/Devices/1B9238A9-7066-4BE5-9CA7-177D26014FC2/data/Containers/Bundle/Application/72590E8D-686D-4932-B2FE-113A5FD68245/behaveExample.app/should.js:1912:70\\nrequire@[native code]\\nfile:///Users/Nikesh/Library/Developer/CoreSimulator/Devices/1B9238A9-7066-4BE5-9CA7-177D26014FC2/data/Containers/Bundle/Application/72590E8D-686D-4932-B2FE-113A5FD68245/behaveExample.app/test/app_test.js:1:139\\nglobal code@file:///Users/Nikesh/Library/Developer/CoreSimulator/Devices/1B9238A9-7066-4BE5-9CA7-177D26014FC2/data/Containers/Bundle/Application/72590E8D-686D-4932-B2FE-113A5FD68245/behaveExample.app/test/app_test.js:41:70\\nrequire@[native code]\\nfile:///Users/Nikesh/Library/Developer/CoreSimulator/Devices/1B9238A9-7066-4BE5-9CA7-177D26014FC2/data/Containers/Bundle/Application/72590E8D-686D-4932-B2FE-113A5FD68245/behaveExample.app/alloy/controllers/index.js:65:16\";\r\n[ERROR] : }\r\n[ERROR] : Script Error Module \"should\" failed to leave a valid exports object\r\n[ERROR] : Script Error Module \"test/app_test\" failed to leave a valid exports object\r\n[ERROR] : ErrorController is up. ABORTING showing of modal controller\r\n[ERROR] : ErrorController is up. ABORTING showing of modal controller\r\n", "attachment": [], "flagged": false, "summary": "Should.js is not working for ti.mocha", "creator": { "name": "Gourav", "key": "gourav", "displayName": "Gourav", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "Gourav", "key": "gourav", "displayName": "Gourav", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.11.1\r\n Architecture = 64bit\r\n\r\n\r\nTitanium CLI\r\n CLI Version = 5.0.5\r\n node-appc Version = 0.2.31\r\n\r\nTitanium SDKs\r\n 5.1.2.GA\r\n Version = 5.1.2\r\n\r\nMac OS X\r\n Command Line Tools = installed\r\n", "comment": { "comments": [ { "id": "379681", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nPlease provide a regeneratable sample code for the issue you have mentioned above. We will try it in our environment if the issue is regeneratable or not. Please use the latest SDK 5.2.0.GA for your test. Also please provide a complete list of steps to follow.\r\n\r\nThanks.\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-03-14T19:09:49.000+0000", "updated": "2016-03-14T19:09:49.000+0000" }, { "id": "379718", "author": { "name": "Gourav", "key": "gourav", "displayName": "Gourav", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi,\r\n\r\nAs mentioned in the document by tonylukasavage, I am using the same basic example.\r\n\r\nAt Index.js\r\nrequire('ti-mocha');\r\n\r\n// create a basic UI\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff',\r\n fullscreen: false,\r\n exitOnClose: true,\r\n id: 'myWindow'\r\n});\r\nvar view = Ti.UI.createView({\r\n height: Ti.UI.FILL,\r\n width: Ti.UI.FILL,\r\n backgroundColor: '#a00',\r\n id: 'myView'\r\n});\r\nwin.add(view);\r\nsetTimeout(function(){\r\n\trequire('test/app_test')(win, view);\r\n},100);\r\n\r\n\r\n// For app_test \r\nvar should = require('should');\r\n module.exports = function(win, view) {\r\n\r\n describe('app.js', function() {\r\n \r\n describe('#myWindow', function() {\r\n\r\n it('exists', function() {\r\n should.exist(win);\r\n win.id.should.equal('myWindow');\r\n });\r\n\r\n it('has Ti.UI.Window functions', function() {\r\n should(win.open).be.a.Function;\r\n should(win.close).be.a.Function;\r\n\r\n if (Ti.Platform.name === 'iPhone OS') {\r\n should(win.hideTabBar).be.a.Function;\r\n }\r\n });\r\n\r\n it('has dimensions equal to the device', function() {\r\n win.size.height.should.equal(Ti.Platform.displayCaps.platformHeight);\r\n win.size.width.should.equal(Ti.Platform.displayCaps.platformWidth);\r\n });\r\n\r\n });\r\n\r\n describe('#myView', function() {\r\n\r\n it('exists', function(){\r\n should.exist(view);\r\n view.id.should.equal('myView');\r\n });\r\n\r\n it('has Ti.UI.View functions', function() {\r\n // should(view.add).be.a.Function;\r\n should(win.open).be.a.Function; // will work as expected\r\n });\r\n\r\n it('is a child of window', function() {\r\n win.children.length.should.equal(1);\r\n should.exist(win.children[0]);\r\n win.children[0].id.should.equal('myView');\r\n });\r\n\r\n it('view has same dimensions as window', function(){\r\n view.size.height.should.equal(win.size.height);\r\n view.size.width.should.equal(win.size.width);\r\n });\r\n\r\n });\r\n\r\n });\r\n\r\n // run the tests\r\n mocha.run();\r\n\r\n\r\nCan you please check it now.\r\n\r\n\r\n", "updateAuthor": { "name": "Gourav", "key": "gourav", "displayName": "Gourav", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-03-15T06:57:24.000+0000", "updated": "2016-03-15T06:57:24.000+0000" }, { "id": "380191", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I was able to regenerate the issue using the instruction to use should.js with ti-mocha in here http://tonylukasavage.com/ti-mocha/. I post a comment in the blog. I would suggest you follow the blog for response. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-03-20T18:55:37.000+0000", "updated": "2016-03-20T18:55:37.000+0000" }, { "id": "380895", "author": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Same issue for me. Please help on this.", "updateAuthor": { "name": "nagaharish", "key": "nagaharish", "displayName": "Naga harish M", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2016-03-29T07:51:54.000+0000", "updated": "2016-03-29T07:51:54.000+0000" }, { "id": "403208", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, This issue is fixed in SDK 6.0.0.GA. I just tested it in Android 6.0.1 device. Verified:\r\n{code}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.11.6\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 4.2.2\r\n npm Version = 2.14.7\r\nTitanium CLI\r\n CLI Version = 5.0.10\r\nTitanium SDK\r\n SDK Version = 6.0.0.GA\r\n Target Platform = android\r\n{code}\r\nOutput:\r\n{code}\r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K app.js\r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K #myWindow\r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K o exists: \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K\u001b[1F\u001b[0G\u001b[2K + exists \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K o has Ti.UI.Window functions: \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K\u001b[1F\u001b[0G\u001b[2K + has Ti.UI.Window functions \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K o has dimensions equal to the device: \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K\u001b[1F\u001b[0G\u001b[2K 1) has dimensions equal to the device\r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K #myView\r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K o exists: \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K\u001b[1F\u001b[0G\u001b[2K + exists \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K o has Ti.UI.View functions: \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K\u001b[1F\u001b[0G\u001b[2K + has Ti.UI.View functions \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K o is a child of window: \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K\u001b[1F\u001b[0G\u001b[2K + is a child of window \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K o view has same dimensions as window: \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K\u001b[1F\u001b[0G\u001b[2K + view has same dimensions as window \r\n[INFO] : \u001b[0G\u001b[2K\u001b[0G\u001b[2K \r\n[INFO] : \u001b[0G\u001b[2K\r\n[INFO] : \u001b[0G\u001b[2K 6 passing (321ms)\r\n{code}\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-12-12T20:24:56.000+0000", "updated": "2016-12-12T20:24:56.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }