chronocat/packages/engine-chronocat-api/tests/mocks/index.ts
Maiko Sinkyaet Tan 8540f32c4b
fix(api): <br> and <p> linebreak not correctly rendered (#10)
* fix: `<br>` and `<p>` linebreak not correctly rendered

* refa: remove reduce function

* refa: use placeholder for linebreak implementation

* fix: should handle continuation of p element

* fix: dangling paragraph start mark not correctly handled

* fix: align with browser behaviour for `<p>` and `<br>`

* fix: remove redundant process
2024-10-05 11:06:39 +08:00

58 lines
1.2 KiB
TypeScript

// @ts-nocheck
import type { ChronocatContext } from '@chronocat/shell'
import h from '@satorijs/element'
export const ctx: ChronocatContext = {
chronocat: {
api: {
'chronocat.internal.red.message.parse': (() => {
const fn = (async () =>
undefined) as unknown as ChronocatContext['chronocat']['api']['chronocat.internal.red.message.parse']
fn.notimpl = false
fn.engine = 'engine-mock'
fn.priority = 0
return fn
})(),
} as ChronocatContext['chronocat']['api'],
l: {
info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
debug: jest.fn(),
} as unknown as ChronocatContext['chronocat']['l'],
h,
} as ChronocatContext['chronocat'],
chronocatEngineChronocatApi: {
msgBoxActiv: {
activate: () => {},
},
},
}
export const satoriConfig = {
type: 'satori',
listen: '0.0.0.0',
port: 5500,
self_url: 'https://chronocat.vercel.app',
token: 'DEFINE_CHRONO_TOKEN',
enable: true,
} as const
export const saveResult = {
filePath: '',
fileSize: 0,
fileName: '',
fileMime: '',
md5: '',
imageInfo: {
width: 0,
height: 0,
type: 'png',
mime: 'image/png',
wUnits: '1',
hUnits: '1',
},
}