diff --git a/test/helpers/index.js b/test/helpers/index.js index e9df664ee3..6ca11e9252 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -6,7 +6,7 @@ const nconf = require('nconf'); const fs = require('fs'); const winston = require('winston'); -const utils = require('../../public/src/utils'); +const utils = require('../../src/utils'); const helpers = module.exports; diff --git a/test/utils.js b/test/utils.js index b76196c3eb..58d0ef2299 100644 --- a/test/utils.js +++ b/test/utils.js @@ -3,7 +3,6 @@ const assert = require('assert'); const { JSDOM } = require('jsdom'); -const utils = require('../public/src/utils'); const slugify = require('../src/slugify'); const db = require('./mocks/databasemock'); @@ -11,14 +10,16 @@ describe('Utility Methods', () => { // https://gist.github.com/robballou/9ee108758dc5e0e2d028 // create some jsdom magic to allow jQuery to work const dom = new JSDOM('
'); - const { window } = dom; - global.window = window; + global.window = dom.window; + global.document = dom.window.document; global.jQuery = require('jquery'); global.$ = global.jQuery; const { $ } = global; require('jquery-deserialize'); require('jquery-serializeobject'); + const utils = require('../public/src/utils'); + it('should serialize/deserialize form data properly', () => { const formSerialize = $(`