]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: refactor utils in test
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 2 May 2019 10:55:33 +0000 (12:55 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 2 May 2019 10:55:33 +0000 (12:55 +0200)
__tests__/html5.spec.js

index ec90379037e3b92616190743c2dc6fca070c0066..7a714011e5e537351fd7fc4f5365250105d8e92f 100644 (file)
@@ -2,22 +2,11 @@
 require('./helper')
 const expect = require('expect')
 const { HTML5History } = require('../src/history/html5')
-const { JSDOM } = require('jsdom')
+const { createDom } = require('./utils')
 
 describe.skip('History HTMl5', () => {
   beforeAll(() => {
-    // TODO: move to utils for tests that need DOM
-    const dom = new JSDOM(
-      `<!DOCTYPE html><html><head></head><body></body></html>`,
-      {
-        url: 'https://example.org/',
-        referrer: 'https://example.com/',
-        contentType: 'text/html',
-      }
-    )
-
-    // @ts-ignore
-    global.window = dom.window
+    createDom()
   })
 
   it('can be instantiated', () => {