From ae0fbaa6468711c6fbd5c5697cb8008d835ed323 Mon Sep 17 00:00:00 2001 From: bordun Date: Tue, 17 Mar 2020 19:49:12 +0100 Subject: [PATCH] test: fix scripts --- scripts/client-shim.js | 2 +- tests/test.js | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/client-shim.js b/scripts/client-shim.js index a74e5786..7094b2c7 100644 --- a/scripts/client-shim.js +++ b/scripts/client-shim.js @@ -67,7 +67,7 @@ Object.assign(global, window) // Required globals -DOM = require('../src/client/app/dom') +DOM = require('../src/client/dom') DOM.get = x=>[{addEventListener:()=>{}}] DOM.init() ELECTRON_NOGPU = false diff --git a/tests/test.js b/tests/test.js index 968e6855..10bf719e 100644 --- a/tests/test.js +++ b/tests/test.js @@ -8,11 +8,22 @@ var session = {type: 'root', tabs:[{widgets:[]}]}, require('../scripts/client-shim') -var {widgets} = require('../src/client/app/widgets') -for (let type in widgets) { - if (type !== 'tab' && type !== 'root' && type !== 'patchbaynode') { - console.log(type) - session.tabs[0].widgets.push({type: type}) +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'], +} +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}) + } } } @@ -35,7 +46,7 @@ function std(data){ console.error(data.toString()) console.log('\033[31m\n=> Test errored ✘\n\033[0m') - end() + end(true) } }