LogicAppUnit / TestingFramework

Unit testing framework for Azure Logic Apps (Standard)
MIT License
23 stars 11 forks source link

testConfiguration.json should not be empty? #28

Closed jeanpaulsmit closed 6 months ago

jeanpaulsmit commented 8 months ago

I'm trying the framework for use in our Logic Apps Standards solution and according to the wiki the testConfiguration.json can be empty. However, while testing I got the "The test configuration could not be loaded" exception, although the file was there and I copied the {} value as mentioned in the wiki.

Copying over the contents from the repo it started to work right away. The same result when I empty the testConfiguration.json in the example from the repo.

Thanks for building and maintaining this framework!

mark-abrams commented 8 months ago

Hi @jeanpaulsmit , thank you for raising this issue. I'm sure the framework used to work with a testConfiguration.json file containing nothing but {}, but as you say, it now throws an error and it should not.

All of the test configuration settings have default values and therefore there is no reason why a test configuration file containing {} should break. Additionally, there is no real reason why a developer must have a testConfiguration.json file - in both cases the test framework should simply use the default values for all settings.

I'll fix this in the next version so that (i) the testConfiguration.json file is optional and (ii) a file containing {} does not break things. In both cases, default settings will be used.

mark-abrams commented 8 months ago

@jeanpaulsmit , thanks for providing your PR contribution and feedback, it is always good to see how people are using the framework. Please give a star for the framework, and raise an issue for any other issues or improvements you would like to see.

mark-abrams commented 6 months ago

I have released version 1.9.0 of LogicAppUnit which treats the test configuration file as optional. Additionally, a file containing an empty JSON document ({ }) is permitted. In both cases, the default configuration values will be used.

This new behaviour is documented in the wiki.