tests: add basic test for all widgets and add eslint to npm test

This commit is contained in:
bordun 2018-10-29 13:01:13 +01:00
parent b228331aa8
commit b1f0e893a8
5 changed files with 50 additions and 42 deletions

View file

@ -1,43 +1,4 @@
// Dirty browser window shim
document = {
createElementNS: x=>[],
addEventListener: ()=>{},
createRange: ()=>{
return {
createContextualFragment:()=>{return {
firstChild: {
querySelectorAll: x=>[]
}
}},
selectNode: ()=>{}
}
},
body: {
appendChild: ()=>{}
}
}
window = {
addEventListener: ()=>{},
location: {},
document: document,
navigator: {
platform:''
},
NodeList: Array,
WebSocket: Object
}
Object.assign(global, window)
// Required globals
DOM = require('../src/client/app/dom')
DOM.get = x=>[{addEventListener:()=>{}}]
DOM.init()
CANVAS_FRAMERATE = 1
LANG = 'en'
require('./client-shim')
// Here we go