chore: remove references to jest

This commit is contained in:
Nolan Lawson 2024-03-09 09:52:19 -08:00
parent b6730a696e
commit aa3a192fe7
4 changed files with 5 additions and 7 deletions

View File

@ -197,7 +197,7 @@ export function createRoot (shadowRoot, props) {
// mount logic
if (!state.emojiVersion) {
detectEmojiSupportLevel().then(level => {
// Can't actually test emoji support in Jest/JSDom, emoji never render in color in Cairo
// Can't actually test emoji support in Jest/Vitest/JSDom, emoji never render in color in Cairo
/* istanbul ignore next */
if (!level) {
state.message = state.i18n.emojiUnsupportedMessage
@ -312,7 +312,7 @@ export function createRoot (shadowRoot, props) {
const { database } = state
const favs = (await Promise.all(MOST_COMMONLY_USED_EMOJI.map(unicode => (
database.getEmojiByUnicodeOrName(unicode)
)))).filter(Boolean) // filter because in Jest tests we don't have all the emoji in the DB
)))).filter(Boolean) // filter because in Jest/Vitest tests we don't have all the emoji in the DB
state.defaultFavoriteEmojis = favs
}

View File

@ -8,7 +8,7 @@
import { FONT_FAMILY } from '../constants'
import { versionsAndTestEmoji } from '../../../bin/versionsAndTestEmoji'
// only used in jest tests
// only used in jest/vitest tests
let simulateCanvasError = false
export function setSimulateCanvasError (value) {
simulateCanvasError = value
@ -51,7 +51,7 @@ export function testColorEmojiSupported (text) {
.map(([emoji]) => emoji)
.includes(text)
}
return true // avoid using canvas in jest
return true // avoid using canvas in jest/vitest
}
// Render white and black and then compare them to each other and ensure they're the same
// color, and neither one is black. This shows that the emoji was rendered in color.

View File

@ -6,7 +6,7 @@ import { requestAnimationFrame } from './requestAnimationFrame'
export let resizeObserverSupported = typeof ResizeObserver === 'function'
// only used in jest tests
// only used in jest/vitest tests
export const resetResizeObserverSupported = () => {
resizeObserverSupported = typeof ResizeObserver === 'function'
}

View File

@ -19,7 +19,6 @@ describe('errors', () => {
await tick(40)
})
// seems not possible to do
test('throws error when setting the database', async () => {
const picker = new Picker({ dataSource: ALL_EMOJI, locale: 'en' })
document.body.appendChild(picker)
@ -32,7 +31,6 @@ describe('errors', () => {
await tick(20)
})
// can't seem to get jest to ignore these expected errors
test('offline shows an error', async () => {
const dataSource = 'error.json'