This project is read-only.

Typescript Compiler Test strategy

Topics: General
May 18, 2014 at 11:04 AM
Edited May 18, 2014 at 11:04 AM
Hello, I am trying to create a little typescript fork that add a new syntax element to the language.

I don't understand the test strategy of the typescript compiler:
For example what are Fidelity test and when should they be preferred to normal test cases ?
Same question for Fourslash tests ?

Also the diagnostic code seems to be generated, but the repository does not seems to contain the script generating them, should I had my new diagnostic code manually ?

François de Campredon
May 19, 2014 at 7:46 PM
Fidelity tests are only for the parser. Fourslash tests are for language service features (ex if you were adding a 'protected' keyword you would write fourslash tests to verify the completion list shows and doesn't show the protected member in various places). The tests in .../tests/cases/compiler and /tests/cases/conformance are for verifying error messages, type checking, and emit (obviously these then also verify parsing at a high level and you likely don't need to write Fidelity tests).
May 19, 2014 at 8:46 PM
Ok thanks a lot for your answer.
And for the diagnostic codes ? do you manage them manually or do you generate them ?
May 19, 2014 at 9:13 PM
We do have some scripts we use for that which we're currently in the process of cleaning up for checkin to the public repo. In the meantime you'll just have to manage them manually unfortunately.
May 19, 2014 at 9:42 PM
OK thanks a lot for your time, I guess I'll wait for this part.