Files
ycode/scripts/test-terminal-host-plugin.ts
T

15 lines
850 B
TypeScript

import type { Plugin } from 'esbuild'
/** Conversation suites never create native terminals. Dedicated regressions use real ConPTY. */
export const testTerminalHostPlugin: Plugin = {
name: 'terminal-outside-conversation-test-scope',
setup(build) {
build.onResolve({ filter: /^\.\/terminal-host$/ }, () => ({ path: 'terminal-host', namespace: 'test-terminal-host' }))
build.onLoad({ filter: /.*/, namespace: 'test-terminal-host' }, () => ({ loader: 'js', contents: `
const unexpected = () => { throw new Error('Native terminal invoked outside dedicated terminal regression'); };
export const createTerminal=unexpected,getTerminal=unexpected,writeTerminal=unexpected,resizeTerminal=unexpected,
clearTerminal=unexpected,closeTerminal=unexpected,rebindTerminal=unexpected,disposeTerminalHosts=unexpected;
` }))
}
}