mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Merge pull request #4143 from alphagov/swap-domdiff-for-morphdom
Replace domdiff library with morphdom
This commit is contained in:
@@ -31,13 +31,12 @@ beforeAll(() => {
|
||||
|
||||
$.ajax.mockImplementation(() => jqueryAJAXReturnObj);
|
||||
|
||||
// using require to execute the version we use in our our frontend build here can't add
|
||||
// the domdiff variable to this scope like it does when executed in browsers because
|
||||
// that version doesn't export it
|
||||
// we use CommonJS version instead because it does (as the default property)
|
||||
// see https://nodejs.org/en/knowledge/getting-started/what-is-require/ for more info
|
||||
// also, we're not a browser so we need to manually attach domdiff to window
|
||||
window.domdiff = require('domdiff/cjs').default;
|
||||
// RollupJS assigns our bundled module code, including morphdom, to window.GOVUK.
|
||||
// morphdom is assigned to its vendor property so we need to copy that here for the updateContent
|
||||
// code to pick it up.
|
||||
window.GOVUK.vendor = {
|
||||
morphdom: require('morphdom')
|
||||
};
|
||||
require('../../app/assets/javascripts/updateContent.js');
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user