From c43f970720c13ac16594cee893547df336aff0bc Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 12 Sep 2025 22:19:25 +0200 Subject: [PATCH] misc: rm test script for now --- package.json | 2 +- tests/test.js | 64 --------------------------------------------------- 2 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 tests/test.js diff --git a/package.json b/package.json index 9dba8486..f3b89aa1 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "watch-launcher": "npm run build-launcherr-js -- --watch", "build-docs": "rollup -c scripts/docs.rollup.config.js && node src/docs/widgets-reference.js > resources/docs/docs/widgets/properties-reference.md && cd resources && python3 -m mkdocs build", "lint": "eslint src --ext mjs", - "test": "npm run lint && npm run build && node tests/test.js" + "test": "npm run lint && npm run build" }, "engines": { "node": ">=16 <=20" diff --git a/tests/test.js b/tests/test.js deleted file mode 100644 index 924f455d..00000000 --- a/tests/test.js +++ /dev/null @@ -1,64 +0,0 @@ -// Very simple test: load a session with 1 widget of each type -var fs = require('fs') - -// create tmp session file - -var session = {type: 'root', tabs:[{widgets:[]}]}, - sessionPath = 'test-session.json' - -require('../scripts/client-shim') - -var widgets = { - 'Basics':['button', 'switch', 'dropdown', 'menu', 'input', 'file'], - 'Containers':['panel', 'modal', 'clone', 'matrix', 'keyboard', 'patchbay'], - 'Frames':['frame', 'svg', 'html', 'image'], - 'Graphs':['plot','eq','visualizer'], - 'Indicators':['led', 'text'], - 'Pads':['xy','rgb','multixy', 'canvas'], - 'Sliders':['fader','knob', 'encoder', 'range'], - 'Scripts':['script', 'variable'], -} -for (let k in widgets) { - for (let type of widgets[k]) { - if (type !== 'tab' && type !== 'root' && type !== 'patchbaynode') { - console.log(type) - session.tabs[0].widgets.push({type: type}) - } - } -} - -fs.writeFileSync(sessionPath, JSON.stringify(session)) - - -// spawn o-s-c in headless mode and load tmp session - -var {spawn} = require('child_process') - -var proc = spawn('xvfb-run', `npm start -- -l ${sessionPath}`.split(' '), {detached: true}) - -proc.stdout.on('data', std) -proc.stderr.on('data', std) - - -function std(data){ - - if (data.includes('process error')) { - console.error(data.toString()) - console.log('\033[31m\n=> Test errored ✘\n\033[0m') - - end(true) - } - -} - -// timeout after 5s -> no error -setTimeout(()=>{ - console.log('\033[36m\n=> Test timeout without error ✔\n\033[0m') - end() -}, 5000) - -function end(fail){ - proc.kill() - fs.unlinkSync(sessionPath) - process.exit(fail ? 1 : 0) -}