testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

feat: added typescript testcaferc configuration file support

Open Bayheck opened this issue 1 year ago • 3 comments

Purpose

Describe the problem you want to address or the feature you want to implement. Added support for TypeScript configuration file (testcaferc.ts) so TS code can be referenced in global hooks and similar functionality. However, defining options for testcaferc.ts compilation itself is only possible from CLI. We can define them using --compiler-options. If no options are provided in CLI we use default compiler with default compilation options.

Approach

Describe how your changes address the issue or implement the desired functionality in as much detail as possible. Added new methods in \src\configuration\testcafe-configuration.ts: _readTsConfigurationFileContent, _isTSConfiguration and _readConfigurationOptions.

Added new method in \src\compiler\test-file\formats\typescript\compiler.ts: compileConfiguration.

Inside testcafe-configuration.ts If config file is a ts config, then call _readTsConfigurationFileContent.

Also in \src\index.js pass compilerOptions to configuration.init().

Wrote tests for testing the above mentioned functionality inside \test\server\configuration-test.js

Provide a link to the existing issue(s), if any. closes https://github.com/DevExpress/testcafe/issues/7373

Pre-Merge TODO

  • [x] Write tests for your proposed changes
  • [x] Make sure that existing tests do not fail

Bayheck avatar Oct 11 '23 14:10 Bayheck

is there any progress here?

We could really use this feature and everything in this PR seem Green and Approved. Anything missing?

lukas-zech-software avatar Jan 24 '24 11:01 lukas-zech-software

@lukas-zech-software We are not merging this PR since we think this feature still needs improvement. I cannot give you an ETA at this time since my predictions may not be accurate.

Bayheck avatar Jan 25 '24 15:01 Bayheck

So excited for this!

Jackman3005 avatar Feb 21 '24 07:02 Jackman3005