0

I have some typescript tests which are running fine using Chutzpa to run them.

Today I added a property of type Map<K,V> to my model being tested and now all tests which use that model fail when I run them using the headless (PhantomJS) runner. They do, however, work if I tell Chutzpah to run them in the browser (chrome)

The error I get is

Can't find variable: Map in 'some path'

but the JS files are removed by Chutzpah so I can't open them and see what the issue is.

I suspect that it might be some typescript version issue (the headless runner is using an older typescript version maybe) but am not sure how to either prove this or make the headless runner use a specified version of typescript.

Sam Holder
  • 32,535
  • 13
  • 101
  • 181

1 Answers1

1

Two things.

First itt sounds like you are using the legacy compilation mode in Chutzpah. That mode is no-recommended since it uses a fixed version of TypeScript to compile the JS. You should use the recommended Compile settings.

Second, if it is working in the browser and not in Phantom and Chutzpah is compiling both then it is probably not a typescript issues. If you run chutzpah from the command line you can set the /debug flag which is leave the HTML files around to investigate.

Matthew Manela
  • 16,572
  • 3
  • 64
  • 66
  • Thanks. I'll try that in the morning. Much appreciated. – Sam Holder Oct 31 '14 at 21:43
  • I'm not sure what fixed it but after I ran it with the command line tool I could no longer get it to fail. However I can't get it to work with the external compile & chutzpah.json file. It does not seem to include the actual test file into the html test file so never runs any tests. Looking at the logs doesn't seem to help me at all. I've marked this as accepted as I am able to run the tests again, and I'll ask another question about the config later after a bit more investigation. – Sam Holder Nov 03 '14 at 20:38
  • Sure, and if you do ask that question please create a repo that I can download and test with. – Matthew Manela Nov 03 '14 at 22:14
  • Just posted the [other question](http://stackoverflow.com/questions/26724360/problems-running-tests-with-chutzpah-when-i-use-the-chutzpah-json-file), I'll try and create a minimal repo, but it will have to be tomorrow evening now, its late and time for bed :). Thanks for the help though, and thanks for Chutzpah, its a great tool. – Sam Holder Nov 03 '14 at 22:23