Files
image-workbench-desktop/tests/runtime-diagnostics-hotpath-test.js

15 lines
859 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const assert = require('assert')
const fs = require('fs')
const path = require('path')
// 2026-10-29:runNode / saveNow 已搬到 src/runtime-workbench-logic.js ⇒ 合并文本一起检查。
const app = fs.readFileSync(path.resolve(__dirname, '..', 'app.js'), 'utf8') + '\n' +
fs.readFileSync(path.resolve(__dirname, '..', 'src', 'runtime-workbench-logic.js'), 'utf8')
assert.match(app, /function iwbDebugCounter\(name, extra\)/)
assert.match(app, /iwbDebugCounter\('commitCanvas'/)
assert.match(app, /iwbDebugCounter\('saveNow'/)
assert.match(app, /iwbDebugCounter\('saveDebounced'/)
assert.match(app, /iwbDebugCounter\('storeOutputThumb:start'/)
assert.match(app, /iwbDebugCounter\('archiveGenerationResults'/)
assert.match(app, /if \(n\.type === 'out' && \(n\.w \|\| NODE_W\) < 420\)/)
console.log('runtime diagnostics instrumentation checks passed')