Skip to content

Regression: "Keys" option not respected, upon performing validation for named validation contextΒ #477

@KrisjanisStrods

Description

@KrisjanisStrods

It seems to me, that the last version, where the keys option was respected, was in [email protected].

Created a unit test for v3.4.1, that showcases the problem:

import { expect } from 'expect'

import { SimpleSchema } from '../src/SimpleSchema.js'

describe.only('regression', function () {
  it('check if applied keys option array is respected', function () {
    const targetSchmea = new SimpleSchema({
      foo: {
        type: String
      },
      bar: {
        type: String
      }
    })

    targetSchmea
      .namedContext('testContext')
      .validate({ foo: 'bizz' }, { keys: ['foo'] })

    // If keys option would be respected, there should not be any validation errors
    expect(targetSchmea.namedContext('testContext').validationErrors().length).toBe(0)
  })
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions