mirror of
https://github.com/n8n-io/n8n.git
synced 2026-07-28 03:24:59 +02:00
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
35 lines
895 B
TypeScript
35 lines
895 B
TypeScript
expect.extend({
|
|
toBeEmptyArray(actual: unknown) {
|
|
const pass = Array.isArray(actual) && actual.length === 0;
|
|
|
|
return {
|
|
pass,
|
|
message: pass
|
|
? () => `Expected ${actual} to be an empty array`
|
|
: () => `Expected ${actual} not to be an empty array`,
|
|
};
|
|
},
|
|
|
|
toBeEmptySet(actual: unknown) {
|
|
const pass = actual instanceof Set && actual.size === 0;
|
|
|
|
return {
|
|
pass,
|
|
message: pass
|
|
? () => `Expected ${[...actual]} to be an empty set`
|
|
: () => `Expected ${actual} not to be an empty set`,
|
|
};
|
|
},
|
|
|
|
toBeSetContaining(actual: unknown, ...expectedElements: string[]) {
|
|
const pass = actual instanceof Set && expectedElements.every((e) => actual.has(e));
|
|
|
|
return {
|
|
pass,
|
|
message: pass
|
|
? () => `Expected ${[...actual]} to be a set containing ${expectedElements}`
|
|
: () => `Expected ${actual} not to be a set containing ${expectedElements}`,
|
|
};
|
|
},
|
|
});
|