// This file gets added to the page via /app/views/shared/_head
// That Rails view also adds several JavaScript globals to the page,
// including the available locales and wikis, the Features enabled,
// and other static (from a JavaScript perspective) data objects.


// Polyfill
import '@babel/polyfill';

require('location-origin');
require('@rails/ujs').start(); // Enables rails-ujs, which adds JavaScript enhancement to some Rails views
window.List = require('list.js'); // List is used for sorting tables outside of React

document.addEventListener('DOMContentLoaded', () => {
  /* eslint-disable */
  // We need to bundle everything in main.js instead of loading dynamically
  // because we will be splitting up the modules in main.js for coverage later
  window.I18n = require('i18n-js');
  require('./utils/course.js');
  require('./components/app.jsx');
  require('./utils/editable.js');
  require('./utils/users_profile.js');
  require('events').EventEmitter.defaultMaxListeners = 30;
  /* eslint-enable */
});

@@ -1,12 +1,603 @@
+/*%0A  This file replaces normal main.js when we enable COVERAGE=true in RSpec tests.%0A%0A  The reason we have a separate version of main.js for coverage is because the%0A  coverage relies on all the components being embedded in the main bundle.%0A%0A  The main.js file uses dynamic importing via import() which splits those components into separate files.%0A  This file instead uses require() which embeds all the required code within main bundle.%0A%0A  This file should replicate the contents of main.js with the exception that this should have%0A  require() instead of import() for the above reasons.%0A*/%0A%0A%0A
 // This file

document the reson for existence of a separate main-coverage.js