/
githubmirror
/
strapi
Обзор
Документация
Войти
/
githubmirror
/
strapi
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
tests/setup/jest-api.setup.js
22 строки
603 B
markkaylor
chore(audit-logs): migrate audit logs to v5 (#20251)
27 май 2024, 10:30
Не верифицирован
27 май 2024, 10:30
f75e3c6
Код
Авторство
О чём код?
'use strict'; const isoDateRegex = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/; jest.setTimeout(60000); expect.extend({ stringOrNull(received) { const pass = typeof received === 'string' || received === null; return { message: () => `expected ${received} ${pass ? 'not ' : ''}to be null or a string`, pass, }; }, toBeISODate(received) { const pass = isoDateRegex.test(received) && new Date(received).toISOString() === received; return { pass, message: () => `Expected ${received} ${pass ? 'not ' : ''}to be a valid ISO date string`, }; }, });