Creates an adapter function that wraps the provided scope function with a "not" operation. When the returned scope function is executed, it first performs a negation (updating the context to negate evaluations) and then calls the provided scope function.
This is an optimized alternative to using createExprAdapter("not", scopeFn) that avoids
expression parsing overhead by directly applying the negation context.
The scope function to wrap with the "not" operation.
An IScopeFn function that will negate and then execute the provided scope function.
import { createNotAdapter, createEvalAdapter } from "@nevware21/tripwire";
const isTrueFunc = createEvalAdapter((actual: any) => actual === true, "Expected value to be true");
const isNotTrueFunc = createNotAdapter(isTrueFunc);
// Using with addAssertFunc
addAssertFunc("isNotTrue", isNotTrueFunc);
assert.isNotTrue(false); // Passes - false is not true
assert.isNotTrue(true); // Fails - true is true
Export the functions (and global
assert)