Monday 15 June 2015

typescript - Problems running tests with Chutzpah when I use the Chutzpah.json file -



typescript - Problems running tests with Chutzpah when I use the Chutzpah.json file -

i having problems getting chutzpah run typescript tests when provide chutzpah.json file.

my project looks this:

and chutzpah.json file looks this:

{ "compile": { "mode": "external", "extensionswithnooutput": [ ".d.ts" ] }, "tests": [ { "include": "**/**.ts","exclude": "**/**.d.ts" } ], "references": [ {"include": "../../hacapp.web/**/*.ts", "exclude": "../../hacapp.web/**/**.d.ts" } ] }

when run chutzpah.json file 0 tests executed. output of running commandline runner these arguments:

chutzpah.consle.exe /path \hacapp.web\hacapp.web.tests\scrpts\typescripttests.ts /trace /debug

is here

the contents of generated html file doesn't seem contain reference typescripttests.js file:

<head> <meta charset="utf-8" /> <title>qunit tests</title> <link rel="stylesheet" type="text/css" href="file:///c:/users/sam/source/repos/chutzpah-master/consolerunner/bin/debug/testfiles/qunit/qunit.css"/> <script type="text/javascript" src="file:///c:/users/sam/source/repos/chutzpah-master/consolerunner/bin/debug/testfiles/qunit/qunit.js"></script> <script type="text/javascript" src="file:///c:/users/sam/source/repos/haccpapp/hacapp.web/hacapp.web/scripts/jquery-1.10.2.js"></script> <script type="text/javascript" src="file:///c:/users/sam/source/repos/haccpapp/hacapp.web/hacapp.web/scripts/knockout-3.0.0.js"></script> <script> var amdtestpath = ""; if (window.require && typeof window.require === "function" && amdtestpath !== "") { if (window.chutzpah) { window.chutzpah.usingmoduleloader = true; } requirejs.config({ map: { '*': { } } }); window.qunit.config.autostart = false; window.require([amdtestpath], function () { console.log("!!_!! starting qunit inline amd call..."); if (!window._chutzpah_covobj_name) { window.qunit.start(); } }); } </script> </head>

if rename chutzpah.json file no longer used , run command line tool 1 time again time runs tests , this in log file, , html looks like:

<head> <meta charset="utf-8" /> <title>qunit tests</title> <link rel="stylesheet" type="text/css" href="file:///c:/users/sam/source/repos/chutzpah-master/consolerunner/bin/debug/testfiles/qunit/qunit.css"/> <script type="text/javascript" src="file:///c:/users/sam/source/repos/chutzpah-master/consolerunner/bin/debug/testfiles/qunit/qunit.js"></script> <script type="text/javascript" src="file:///c:/users/sam/source/repos/haccpapp/hacapp.web/hacapp.web/scripts/workflow/_chutzpah.1.wfdefinition.js"></script> <script type="text/javascript" src="file:///c:/users/sam/source/repos/haccpapp/hacapp.web/hacapp.web/scripts/jquery-1.10.2.js"></script> <script type="text/javascript" src="file:///c:/users/sam/source/repos/haccpapp/hacapp.web/hacapp.web/scripts/knockout-3.0.0.js"></script> <script type="text/javascript" src="file:///c:/users/sam/source/repos/haccpapp/hacapp.web/hacapp.web.tests/scripts/_chutzpah.1.typescripttests.js"></script> <script> var amdtestpath = ""; if (window.require && typeof window.require === "function" && amdtestpath !== "") { if (window.chutzpah) { window.chutzpah.usingmoduleloader = true; } requirejs.config({ map: { '*': { } } }); window.qunit.config.autostart = false; window.require([amdtestpath], function () { console.log("!!_!! starting qunit inline amd call..."); if (!window._chutzpah_covobj_name) { window.qunit.start(); } }); } </script> </head> <body> <h1 id="qunit-header">unit tests</h1> <h2 id="qunit-banner"></h2> <h2 id="qunit-useragent"></h2> <ol id="qunit-tests"></ol> <div id="qunit-fixture"></div> </body> </html>

what doing wrong configuration?

updated answer

i update reply based on total repro given. original reply preserved below.

the issue default chutzpah set sourcedirectory generated scripts location of chutzpah.json file. setting parent of both source , test folders fixes issue

{ "compile": { "mode": "external", "extensions": [ ".ts" ], "extensionswithnooutput": [ ".d.ts" ], "sourcedirectory": "../../", "outdirectory": "../../" }, "tests": [ { "include": "*/*.ts","exclude": "*/*.d.ts" } ], "references": [ {"include": "../../chutzpaweb/*/*.ts", "exclude": "../../chutzpaweb/*/*.d.ts" } ] }

original answer

without having total repro cannot confirm if solve problem did address couple issues.

{ "compile": { "mode": "external", "extensions": [ ".ts" ], "extensionswithnooutput": [ ".d.ts" ] }, "tests": [ { "include": "*/*.ts","exclude": "*/*.d.ts" } ], "references": [ {"include": "../../hacapp.web/*/*.ts", "exclude": "../../hacapp.web/*/*.d.ts" } ] } i added extensions element compile node chutzpah knows consider input .ts files i changed ** *. wouldn't have caused issue ** isn't needed since * matches 1 or more characters including slashes.

let me know if helps.

typescript qunit chutzpah

No comments:

Post a Comment