diff --git a/app/assets/javascripts/discourse/ember-cli-build.js b/app/assets/javascripts/discourse/ember-cli-build.js index b1082e07c27..3a21935e0c3 100644 --- a/app/assets/javascripts/discourse/ember-cli-build.js +++ b/app/assets/javascripts/discourse/ember-cli-build.js @@ -110,60 +110,6 @@ module.exports = function (defaults) { }, }); - // 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)", - }); - - const tests = concat(appTestTrees, { - inputFiles: ["**/tests/**/*-test.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, - }); - - const testHelpers = concat(appTestTrees, { - inputFiles: [ - "**/tests/loader-shims.js", - "**/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, - }); - - if (isTest) { - return mergeTrees([ - tests, - testHelpers, - discourseScss(`${discourseRoot}/app/assets/stylesheets`, "qunit.scss"), - discourseScss( - `${discourseRoot}/app/assets/stylesheets`, - "qunit-custom.scss" - ), - ]); - } else { - 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"); @@ -191,6 +137,17 @@ module.exports = function (defaults) { .findAddonByName("pretty-text") .treeForMarkdownItBundle(); + let testemStylesheetTree; + if (isTest) { + testemStylesheetTree = mergeTrees([ + discourseScss(`${discourseRoot}/app/assets/stylesheets`, "qunit.scss"), + discourseScss( + `${discourseRoot}/app/assets/stylesheets`, + "qunit-custom.scss" + ), + ]); + } + return app.toTree([ createI18nTree(discourseRoot, vendorJs), parsePluginClientSettings(discourseRoot, vendorJs, app), @@ -214,5 +171,6 @@ module.exports = function (defaults) { }), generateScriptsTree(app), discoursePluginsTree, + testemStylesheetTree, ]); }; diff --git a/app/assets/javascripts/discourse/tests/index.html b/app/assets/javascripts/discourse/tests/index.html index 004e7613e16..f51840ddcf2 100644 --- a/app/assets/javascripts/discourse/tests/index.html +++ b/app/assets/javascripts/discourse/tests/index.html @@ -67,8 +67,7 @@