Quantcast
Channel: Chutzpah - A JavaScript Test Runner
Viewing all articles
Browse latest Browse all 1864

Edited Unassigned: Cannot set working: VS2015 + TypeScript 1.3 + qunit + Chutzpah [291]

$
0
0
Dears,

I'm using the configuration as in the title but I cannot set Chutzpah up to work even if I've rad and tried all'about I've found about using direcly compiled js files, compile with specifying tsc to use, and so on. I'm sure it's my fault but I can't find out the solution it may work for me and now I'm very confused. All the code seems to compile well and using only quint in another project and, without Chutzpah, sync and async tests works fine.

My files are organized in this way:

SolutionDir/cm/data/*.ts => all the classes I want to test are in the CM-project (there are also other folders other than data but for the moment I would be happy let it work for data)

SolutionDir/cm/scipts/*.ts => support classes for all classes in data (only 2 classes are used and 2 .d.ts).

SolutionDir/tests/unit/data/*.ts => all the unit-tests classes are in a separate Tests-project, normally organized in 1 or more files thought to test 1 specific cm/data/xxx.ts file-class using 1 or more test() clause. Also here I have other ./unit/otherforders/*.ts files that tests the same ./cm/data files or other files in ./cm/otherfolders. But I would be happy for now to let the ./data/* bring to work.

SolutionDir/tests/unit/Facroty.ts => factory class I use within allmost all tests and is "referenced" within the test files.

Premise:
1. I've installed the "Chutzpah Test Runner Context Menu Extension" and what here reported comes from starting every time the same test file (with only 1 test() clause) by right click on them and select then "Chutzpah-ICON Run JS Tests" entry.
2. I've placed the Chutzpah.json file and/or the complile.bat file in SolutionDir/tests/unit/data.
3. Installing the "Chutzpah Test Adapter for the Test Explorer" the errors compares on the output windows under the voice "test" every time I compile all

Case 1: not using any Chutzpah.json file
i got many of these: errors TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
I've verified and the errors refers to the use of getters and setters of TS.

Case 2: using only ES5 flag:
Chutzpah.json file:
{
"TypeScriptCodeGenTarget": "ES5"
}
and I got many of these: error TS1008: Unexpected token; 'constructor, function, accessor or variable' expected.
I've verified and the errors refers to the use of "protected" accessor modifiers and so on of TS 1.3.

Case 3: try to use external flag:
Chutzpah.json file:
{
"TypeScriptCodeGenTarget": "ES5",
"Compile": {
"Mode": "External",
"SourceDirectory": "../../../../CM/data"
}
}
and I got only this unique error:
Error: Called start() while already started (QUnit.config.semaphore was 0 already)
While Running:C:\TFS\ChefMagic\dev-cm\Tests\Unit\data\Activity_tests.ts

Case 3: try to use external flag and path settings:
Chutzpah.json file:
{
"TypeScriptCodeGenTarget": "ES5",
"Framework": "qunit",
"Compile": {
"Mode": "External",
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ],
"SourceDirectory": "../../../../CM/data",
"OutDirectory": "../../../../CM/data"
},
"Tests": [
{ "Include": "*.ts", "Exclude": "*.d.ts" }
],
"References": [
{ "Include": "../../../../CM/*/*.ts", "Exclude": "../../../../CM/*/*.d.ts" }
]
}
and i get the same error as before:
Error: Called start() while already started (QUnit.config.semaphore was 0 already)
While Running:C:\TFS\ChefMagic\dev-cm\Tests\Unit\data\Activity_tests.ts

Case 4: specify the tsc for compile:
Chutzpah.json file:
{
"TypeScriptCodeGenTarget": "ES5",
"Framework": "qunit",
"Compile": {
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ],
"Executable": "compile.bat",
"SourceDirectory": "../../../../CM/data",
"OutDirectory": "../../../../CM/data"
},
"Tests": [
{ "Include": "*.ts", "Exclude": "*.d.ts" }
],
"References": [
{ "Include": "../../../../CM/data/*.ts", "Exclude": "../../../../CM/data/*.d.ts" }
]
}
complie.bat file:
@echo off
tsc Activity_tests.ts --sourcemap

and i got the same errors as before: TS1056 and TS1008 that relates to the use of ES5 and TS1.3

Note: If I now remove the Chutzpah.json file at all I got this error:
Chutzpah Error: ChutzpahCompilationFailedException - File not found
While Running:C:\TFS\ChefMagic\dev-cm\Tests\Unit\data\chutzpah.json

So, what's wrong with me? It's important to notice that VS2015 comes with TS allready installed but it seems not to work and so it was necessary to install TS1.3 for 2013 on top of VS2015 after it was ready and then all seems to work perfectly (compilation and quint tests without Chutzpah).

Thank you in advance.
Davide


Viewing all articles
Browse latest Browse all 1864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>