MCPcopy
hub / github.com/CacheControl/json-rules-engine / setup

Function setup

test/engine-event.test.js:314–330  ·  view source on GitHub ↗
(replaceFactsInEventParams, event = eventWithFact)

Source from the content-addressed store, hash-verified

312 const expectedEvent = { type: 'countedEnough', params: { count: 5 } }
313
314 function setup (replaceFactsInEventParams, event = eventWithFact) {
315 const conditions = {
316 any: [
317 {
318 fact: 'success',
319 operator: 'equal',
320 value: true
321 }
322 ]
323 }
324
325 const ruleOptions = { conditions, event, priority: 100 }
326 const countedEnoughRule = factories.rule(ruleOptions)
327 engine = engineFactory([countedEnoughRule], {
328 replaceFactsInEventParams
329 })
330 }
331 context('without flag', () => {
332 beforeEach(() => setup(false))
333 it('"success" passes the event without resolved facts', async () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…