MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / make

Function make

javascript/selenium-webdriver/project_bidi_schema_test.mjs:1034–1049  ·  view source on GitHub ↗
(fieldName, withId = true)

Source from the content-addressed store, hash-verified

1032
1033 it('exempts the envelope `result` position but flags any other correlated reference', () => {
1034 const make = (fieldName, withId = true) => ({
1035 schemaVersion: 1,
1036 commands: [],
1037 events: [],
1038 types: {
1039 Envelope: {
1040 kind: 'record',
1041 fields: [
1042 ...(withId ? [{ name: 'id', wire: 'id', required: true, type: { primitive: 'integer' } }] : []),
1043 { name: fieldName, wire: fieldName, required: true, type: { ref: 'x.ResultData' } },
1044 ],
1045 },
1046 'x.ResultData': { kind: 'union', variants: ['x.A'], selector: { correlated: true } },
1047 'x.A': { kind: 'record', fields: [] },
1048 },
1049 })
1050 assert.deepEqual(checkSchema(make('result')), []) // the envelope's correlation point — allowed
1051 assert.deepEqual(checkSchema(make('payload')), [
1052 'Envelope.payload: correlated union x.ResultData is reachable as a value (needs a payload selector)',

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected