Example I have a file called apiConfig.js
With a simply line of code:
const apiVersion = 'v1';
If I create a file called apiConfig.test.js
How do I write the code to test the const?
Example I have a file called apiConfig.js
With a simply line of code:
const apiVersion = 'v1';
If I create a file called apiConfig.test.js
How do I write the code to test the const?
This is more of a design issue than mechanics.
You should ask yourself why you want to test const.
I like the advice from here to split your code into two parts - one that is parameterized and can be tested properly, and the other which encodes the "constness".