Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify ensureConfigOverride behaves as expected #127

Open
tminard opened this issue Feb 5, 2025 · 0 comments
Open

verify ensureConfigOverride behaves as expected #127

tminard opened this issue Feb 5, 2025 · 0 comments

Comments

@tminard
Copy link

tminard commented Feb 5, 2025

This would be expected to pass:

    describe('when dealing with nested objects', function() {
      it('should not throw if registered field is changed', function() {
        const config = {
          nested: {
            foo: {
              pleaseChangeMe: 'pleaseChangeMe'
            }
          }
        };

        const snapshot = bedrock._snapshotOverrideFields({
          config,
          fields: [
            'nested'
          ]
        });

        // change fields
        config.nested.foo.pleaseChangeMe = 'changed';

        const fn = bedrock._ensureConfigOverride.bind(this, {
          config,
          configOverrideSnapshot: snapshot
        });

        expect(fn).to.not.throw();
      });
    });

However:

  1 failing

  1) bedrock
       _ensureConfigOverride
         when dealing with nested objects
           should not throw if registered field is changed:
     AssertionError: expected [Function bound _ensureConfigOverride] to not throw an error but 'Error: The config field "nested" must…' was thrown

Config values are set in the map directly, but if parent path values are added to fields to watch then they will not be detected as properly changed. Exact desired behavior here when registering root paths needs to be decided

@tminard tminard changed the title BROKEN? ensureConfigOverride doesnt appear to work verify ensureConfigOverride behaves as expected Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant