mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 22:09:55 +00:00
45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
TypeScript
module.exports = async function () {
|
|
global.ResizeObserver = class ResizeObserver {
|
|
observe() {}
|
|
unobserve() {}
|
|
disconnect() {}
|
|
}
|
|
|
|
require('reflect-metadata')
|
|
const { nop } = require('./utils/nopProxy')
|
|
global.enableWebGLCanvas = nop
|
|
|
|
HTMLCanvasElement.prototype.getContext = nop
|
|
|
|
localStorage['Comfy.Settings.Comfy.Logging.Enabled'] = 'false'
|
|
|
|
jest.mock('@/services/dialogService', () => {
|
|
return {
|
|
showLoadWorkflowWarning: jest.fn(),
|
|
showMissingModelsWarning: jest.fn(),
|
|
showSettingsDialog: jest.fn(),
|
|
showExecutionErrorDialog: jest.fn(),
|
|
showTemplateWorkflowsDialog: jest.fn(),
|
|
showPromptDialog: jest
|
|
.fn()
|
|
.mockImplementation((message, defaultValue) => {
|
|
return Promise.resolve(defaultValue)
|
|
})
|
|
}
|
|
})
|
|
|
|
jest.mock('@/stores/toastStore', () => {
|
|
return {
|
|
useToastStore: () => ({
|
|
addAlert: jest.fn()
|
|
})
|
|
}
|
|
})
|
|
|
|
jest.mock('vue-i18n', () => {
|
|
return {
|
|
useI18n: jest.fn()
|
|
}
|
|
})
|
|
}
|