tests: add basic test for all widgets and add eslint to npm test
This commit is contained in:
parent
b228331aa8
commit
b1f0e893a8
5 changed files with 50 additions and 42 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue