Revert "DEV: Support for running theme test with Ember CLI (second attempt)" (#15559)

Revert “DEV: Support for running theme test with Ember CLI (second attempt)” (#15559)

This reverts commit 2c7906999a6f651ec25f15dd7a6dd11c5e892d68.

The changes break some things in local development (putting JS files into minified files, not allowing debugger, and others)

diff --git a/.eslintignore b/.eslintignore
index 3956d17..68b8560 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -12,7 +12,7 @@ lib/highlight_js/
 plugins/**/lib/javascripts/locale
 public/
 vendor/
-app/assets/javascripts/discourse/tests/test-boot-rails.js
+app/assets/javascripts/discourse/tests/test_helper.js
 app/assets/javascripts/discourse/tests/fixtures
 node_modules/
 dist/
diff --git a/.prettierignore b/.prettierignore
index 217c164..3884169 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -20,7 +20,7 @@ lib/highlight_js/
 plugins/**/lib/javascripts/locale
 public/
 vendor/
-app/assets/javascripts/discourse/tests/test-boot-rails.js
+app/assets/javascripts/discourse/tests/test_helper.js
 app/assets/javascripts/discourse/tests/fixtures
 node_modules/
 dist/
diff --git a/app/assets/javascripts/discourse-common/addon/lib/debounce.js b/app/assets/javascripts/discourse-common/addon/lib/debounce.js
index dcd2693..5e30864 100644
--- a/app/assets/javascripts/discourse-common/addon/lib/debounce.js
+++ b/app/assets/javascripts/discourse-common/addon/lib/debounce.js
@@ -11,9 +11,7 @@ let testingFunc = isLegacyEmber() ? run : next;
 
 export default function () {
   if (isTesting()) {
-    // Don't include the time argument (in ms)
-    let args = [].slice.call(arguments, 0, -1);
-    return testingFunc.apply(void 0, args);
+    return testingFunc(...arguments);
   } else {
     return debounce(...arguments);
   }
diff --git a/app/assets/javascripts/discourse/ember-cli-build.js b/app/assets/javascripts/discourse/ember-cli-build.js
index 602f51f..5125e7e 100644
--- a/app/assets/javascripts/discourse/ember-cli-build.js
+++ b/app/assets/javascripts/discourse/ember-cli-build.js
@@ -37,66 +37,8 @@ module.exports = function (defaults) {
       // We don't use SRI in Rails. Disable here to match:
       enabled: false,
     },
-
-    "ember-cli-terser": {
-      enabled: true,
-      exclude: [
-        "**/test-*.js",
-        "**/core-tests*.js",
-        "**/highlightjs/*",
-        "**/javascripts/*",
-      ],
-    },
-
-    // We need to build tests in prod for theme tests
-    tests: true,
   });
 
-  // Patching a private method is not great, but there's no other way for us to tell
-  // Ember CLI that we want the tests alone in a package without helpers/fixtures, since
-  // we re-use those in the theme tests.
-  app._defaultPackager.packageApplicationTests = function (tree) {
-    let appTestTrees = []
-      .concat(
-        this.packageEmberCliInternalFiles(),
-        this.packageTestApplicationConfig(),
-        tree
-      )
-      .filter(Boolean);
-
-    appTestTrees = mergeTrees(appTestTrees, {
-      overwrite: true,
-      annotation: "TreeMerger (appTestTrees)",
-    });
-
-    let tests = concat(appTestTrees, {
-      inputFiles: [
-        "**/tests/acceptance/*.js",
-        "**/tests/integration/*.js",
-        "**tests/unit/*.js",
-      ],
-      headerFiles: ["vendor/ember-cli/tests-prefix.js"],
-      footerFiles: ["vendor/ember-cli/app-config.js"],
-      outputFile: "/assets/core-tests.js",
-      annotation: "Concat: Core Tests",
-      sourceMapConfig: false,
-    });
-
-    let testHelpers = concat(appTestTrees, {
-      inputFiles: [
-        "**/tests/test-boot-ember-cli.js",
-        "**/tests/helpers/**/*.js",
-        "**/tests/fixtures/**/*.js",
-        "**/tests/setup-tests.js",
-      ],
-      outputFile: "/assets/test-helpers.js",
-      annotation: "Concat: Test Helpers",
-      sourceMapConfig: false,
-    });
-
-    return mergeTrees([tests, testHelpers]);
-  };
-
   // WARNING: We should only import scripts here if they are not in NPM.
   // For example: our very specific version of bootstrap-modal.
   app.import(vendorJs + "bootbox.js");
diff --git a/app/assets/javascripts/discourse/package.json b/app/assets/javascripts/discourse/package.json
index 056a33e..32b1092 100644
--- a/app/assets/javascripts/discourse/package.json
+++ b/app/assets/javascripts/discourse/package.json
@@ -34,7 +34,7 @@
     "discourse-common": "^1.0.0",
     "discourse-hbr": "^1.0.0",
     "discourse-widget-hbs": "^1.0.0",
-    "ember-auto-import": "^1.12.0",
+    "ember-auto-import": "^1.10.1",
     "ember-buffered-proxy": "^2.0.0-beta.0",
     "ember-cli": "~3.25.3",
     "ember-cli-app-version": "^4.0.0",
diff --git a/app/assets/javascripts/discourse/public/assets/scripts/discourse-test-listen-boot.js b/app/assets/javascripts/discourse/public/assets/scripts/discourse-test-listen-boot.js
deleted file mode 100644
index 8f46890..0000000
--- a/app/assets/javascripts/discourse/public/assets/scripts/discourse-test-listen-boot.js
+++ /dev/null
@@ -1,4 +0,0 @@
-document.write(
-  "<style>#ember-testing-container { position: fixed; background: white; bottom: 0; right: 0; width: 640px; height: 384px; overflow: auto; z-index: 9999; border: 1px solid #ccc; transform: translateZ(0)} #ember-testing { width: 200%; height: 200%; transform: scale(0.5); transform-origin: top left; }</style>"
-);
-require('discourse/tests/test-boot-ember-cli');
diff --git a/app/assets/javascripts/discourse/tests/active-plugins.js.erb b/app/assets/javascripts/discourse/tests/active-plugins.js.erb
deleted file mode 100644
index 6b29585..0000000
--- a/app/assets/javascripts/discourse/tests/active-plugins.js.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<%
-  DiscoursePluginRegistry.javascripts.each { |js| require_asset(js) }
-  DiscoursePluginRegistry.handlebars.each { |hb| require_asset(hb) }
-  DiscoursePluginRegistry.each_globbed_asset do |f|
-    if File.directory?(f)
-      depend_on(f)
-    else
-      require_asset(f)
-    end
-  end
-%>
diff --git a/app/assets/javascripts/discourse/tests/core-tests.js b/app/assets/javascripts/discourse/tests/core-tests.js
deleted file mode 100644
index 1890b65..0000000
--- a/app/assets/javascripts/discourse/tests/core-tests.js
+++ /dev/null
@@ -1,3 +0,0 @@
-//= require_tree ./acceptance
-//= require_tree ./integration
-//= require_tree ./unit
diff --git a/app/assets/javascripts/discourse/tests/core_plugins_tests.js b/app/assets/javascripts/discourse/tests/core_plugins_tests.js
new file mode 100644
index 0000000..f9c99ce
--- /dev/null
+++ b/app/assets/javascripts/discourse/tests/core_plugins_tests.js
@@ -0,0 +1,4 @@
+//= require_tree ./acceptance
+//= require_tree ./integration
+//= require_tree ./unit
+//= require ./plugin_tests
diff --git a/app/assets/javascripts/discourse/tests/index.html b/app/assets/javascripts/discourse/tests/index.html
index 1c9ac2b..34c33c4 100644
--- a/app/assets/javascripts/discourse/tests/index.html
+++ b/app/assets/javascripts/discourse/tests/index.html
@@ -50,14 +50,9 @@
     <script src="{{rootURL}}assets/test-support.js"></script>
     <script src="{{rootURL}}assets/discourse.js"></script>
     <script src="{{rootURL}}assets/discourse-markdown.js"></script>
-    <script src="{{rootURL}}assets/discourse/tests/active-plugins.js"></script>
+    <script src="{{rootURL}}assets/discourse/tests/core_plugins_tests.js"></script>
     <script src="{{rootURL}}assets/admin.js"></script>
-    <script src="{{rootURL}}assets/test-helpers.js"></script>
-    <script src="{{rootURL}}assets/core-tests.js"></script>
-    <script src="{{rootURL}}assets/discourse/tests/plugin-tests.js"></script>
-    <script>
-      require('discourse/tests/test-boot-ember-cli');
-    </script>
+    <script src="{{rootURL}}assets/tests.js"></script>
     <script src="{{rootURL}}assets/scripts/discourse-boot.js"></script>
 
     {{content-for "body-footer"}}
diff --git a/app/assets/javascripts/discourse/tests/plugin-tests.js.erb b/app/assets/javascripts/discourse/tests/plugin-tests.js.erb
deleted file mode 100644
index f2b3831..0000000
--- a/app/assets/javascripts/discourse/tests/plugin-tests.js.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-<%
-  Discourse.plugins.each do |p|
-    root_path = "#{File.dirname(p.path)}/test/javascripts"
-
-    to_glob = [root_path + '/**/**.es6']
-    to_glob << (root_path + '/**/**.js') if p.transpile_js
-

[... diff too long, it was truncated ...]

GitHub sha: 107239a44295515df87dd78605e62384c6d59962

This commit appears in #15559 which was approved by eviltrout. It was merged by martin.