diff options
Diffstat (limited to 'spec/run.js')
-rw-r--r-- | spec/run.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/run.js b/spec/run.js index 1173cc2..19c5027 100644 --- a/spec/run.js +++ b/spec/run.js @@ -1,4 +1,9 @@ import Jasmine from 'jasmine' +import svgdom from 'svgdom' + +import { buildCanvas, buildFixtures, clear } from './helpers.js' +import { registerWindow } from '../src/main.js' + const jasmine = new Jasmine() //jasmine.loadConfigFile('spec/support/jasmine.json') @@ -14,4 +19,18 @@ jasmine.loadConfig({ ] }) +jasmine.jasmine.currentEnv_.beforeEach(() => { + let win = /*new*/ svgdom + registerWindow(win, win.document) + buildCanvas() + buildFixtures() + global.container = win.document.getElementById('canvas') +}) + +jasmine.jasmine.currentEnv_.afterEach(() => { + clear() + global.container = null + registerWindow() +}) + jasmine.execute() |