Get help with testing, discuss unit testing strategies etc.


Post by chauncey-garrett »

Hello,

We have legacy code that generates a global with a randomly generated value appended to the end. Here's an example:
jQuery17100973413996954473
Would it be possible to extend the expectedGlobals array set in the harness to accommodate variables like this?

Post by mats »

Yes, just docs are outdated - will fix. You can put strings as expected values, but also a regular expression. Better described here:

https://bryntum.com/docs/siesta/#!/api/ ... ectGlobals

Post by mats »

expectedGlobals     : [
            'Ext',
            'MyProject',
            /jQuery\d+/, // Can use RegExp too!
        ],

Post by chauncey-garrett »

Thanks!

Post by jflowers45 »

Took me some googling to find this - I'd initially assumed it wasn't possible since this expectedglobals docs are still out of date - just letting you know !

Post by mats »

Release with updated docs will be out soon! :)

Post Reply