MCPcopy
hub / github.com/palantir/plottable / assertAreaPathCloseTo

Function assertAreaPathCloseTo

test/testMethods.ts:340–349  ·  view source on GitHub ↗
(actualPath: string, expectedPath: string, precision: number, msg: string)

Source from the content-addressed store, hash-verified

338}
339
340export function assertAreaPathCloseTo(actualPath: string, expectedPath: string, precision: number, msg: string) {
341 const actualAreaPathNumbers = tokenizePathString(actualPath);
342 const expectedAreaPathNumbers = tokenizePathString(expectedPath);
343
344 assert.lengthOf(actualAreaPathNumbers, expectedAreaPathNumbers.length, `${msg}: number of numbers in each path should be equal`);
345 actualAreaPathNumbers.forEach((actualAreaNumber, i) => {
346 const expectedAreaNumber = expectedAreaPathNumbers[i];
347 assert.closeTo(+actualAreaNumber, +expectedAreaNumber, 0.1, msg);
348 });
349}
350
351function tokenizePathString(pathString: string) {
352 const numbers: string[] = [];

Callers

nothing calls this directly

Calls 2

tokenizePathStringFunction · 0.85
forEachMethod · 0.45

Tested by

no test coverage detected