mirror of
https://github.com/strapi/strapi.git
synced 2025-07-30 12:29:30 +00:00
17 lines
388 B
JavaScript
17 lines
388 B
JavaScript
expect.extend({
|
|
stringOrNull(received) {
|
|
const pass = typeof received === 'string' || received === null;
|
|
if (pass) {
|
|
return {
|
|
message: () => `expected ${received} not to be null or a string`,
|
|
pass: true,
|
|
};
|
|
} else {
|
|
return {
|
|
message: () => `expected ${received} to be null or a string`,
|
|
pass: false,
|
|
};
|
|
}
|
|
},
|
|
});
|