-
Notifications
You must be signed in to change notification settings - Fork 507
[BUG] setImmutable tests are relying on shared state with other test batches #853
Copy link
Copy link
Closed
Milestone
Description
Describe the bug
vows' 'topic' only runs once per suite, and the way 2-config.test.js is set up, calls like
CONFIG.util.makeImmutable(CONFIG.TestModule, 'arr1');
are actually doing nothing because makeImmutable(CONFIG.TestModule, 'arr1'); is legacy behavior, as documented in the code.
What is actually making this test pass is the 'Configurations from custom environment variables' suite which has called CONFIG.get() a couple dozen times already.
The call we think we are testing ends up short circuiting out instead of going recursive:
// Backwards compatibility mode where property/value can be specified
if (typeof property === 'string') {
return Object.defineProperty(object, property, {
value : (typeof value === 'undefined') ? object[property] : value,
writable : false,
configurable: false
});
}
So all of these tests are not testing the rest of the functionality.
I think one could also argue that all of these tests are also in the wrong order.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels