Upgrading Ember - Issues with Tests

So I took on the task of upgrading our Ember app from 2.16 to 3.26. The application runs fine locally. Got through the lint errors (admit I just turned most of them off and then will turn them on as we can fix them). But for some reason the update and switch from ember-cli-mocha to ember-mocha broke something.

The tests run, then launch the browser like before but then just sit at 0/0 tests. The only warnings I see (other than some SASS warnings about break points) are

WARNING in ./node_modules/mocha/lib/mocha.js 170:20-37 Critical dependency: the request of a dependency is an expression @ ./node_modules/mocha/browser-entry.js @ /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/tests.js @ multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/l.js /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/tests.js

WARNING in ./node_modules/mocha/lib/mocha.js 175:24-70 Critical dependency: the request of a dependency is an expression @ ./node_modules/mocha/browser-entry.js @ /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/tests.js @ multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/l.js /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/tests.js

WARNING in ./node_modules/mocha/lib/mocha.js 213:17-30 Critical dependency: the request of a dependency is an expression @ ./node_modules/mocha/browser-entry.js @ /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/tests.js @ multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/l.js /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/tests.js

WARNING in ./node_modules/mocha/lib/mocha.js 251:26-39 Critical dependency: the request of a dependency is an expression @ ./node_modules/mocha/browser-entry.js @ /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/tests.js @ multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-62122wu2Js3C4WjSi/cache-307-bundler/staging/l.js /private/var/folders/b4/22wprtxxcleaning up… Built project successfully. Stored in “/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/tests-dist-2021212-62122-ig6mc4.67hao”. WARNING: The baseURL and rootURL settings should not be used at the same time.

We have a second project here that did upgrade to ember 3.20 and those tests run. My test files mostly match up with that project but there has to be something small I am missing. Just wondering if anyone had ideas. I can post some of my files here but they seem to match up with the other project and what I see online.

I should mention when I open the browser I can see that the tests are built, there is just something disconnected in getting them to run. After that I can cry about how many are probably broken but first things first.

I started this upgrade a while ago and I thought I had unit tests working and almost passing before but then returned to it and updated it to the latest. That version was 3.4.4 but that feels like years ago.

Any ideas that could be helpful?

Hi, @sanshou. I feel like tests are what makes an Ember upgrade fun to do, with confidence, so I’m sorry to hear that your tests aren’t running anymore.

I haven’t used ember-mocha before, but was wondering if you might have missed updating other test-related package(s) to the latest version. To go from Ember 2.16 to the latest in 3.x, you will likely need to follow migration steps for ember-mocha. I’m not sure if this might help, but recent versions of ember-qunit required a developer to update their test setup. Maybe check it out in case it’s relevant to ember-mocha?

Maybe if you can share your package.json, at least just the packages related to testing (and maybe linting), I think that could help me or others help you debug.

Also make sure the ember-mocha blueprint was run:

ember g ember-mocha

If you did ember install ember-mocha it should have but if you installed via npm/yarn or just manually edited package.json the addon blueprint probably didn’t run and you need to invoke it manually per above.

I did do ember install ember-mocha and ember g ember-mocha just returns unknown blueprint: ember-mocha.

This is the current guts of the package.json file:

"scripts": {
    "default": "ember build",
    "bower": "bower install --allow-root",
    "serve": "grunt serve --port=8443 --live-reload-port=49151",
    "serve:checkout": "grunt serve  --ssl=false --port=9001 --live-reload-port=9002 --localUrl=localhost:9001 --localSessionProxy=true",
    "lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
    "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
    "lint:hbs": "ember-template-lint .",
    "lint:hbs:fix": "ember-template-lint . --fix",
    "lint:js": "eslint . --cache",
    "lint:js:fix": "eslint . --fix",
    "test": "npm-run-all lint test:*",
    "test:ember": "ember test",
    "coverage": "cross-env-shell COVERAGE=true grunt test --server --ssl=false --port=9000",
    "testci": "cross-env COVERAGE=true grunt test --ssl=false --port=9000 --host=127.0.0.1 --launch=selenium-chrome",
    "preinstall": "node fail-if-npm.js",
    "postinstall": "sh copy_dependencies.sh",
    "wdio:test": "node_modules/.bin/wdio  selenium-tests/tmp/runtime_wdio.conf.js"
  },
  "repository": "https://github.snei.sony.com/SIE/valkyrie-transact",
  "license": "UNLICENSED",
  "devDependencies": {
    "@applitools/eyes-selenium": "^4.31.16",
    "@applitools/eyes-webdriverio": "^5.8.3",
    "@babel/cli": "^7.6.4",
    "@babel/core": "^7.6.4",
    "@babel/plugin-transform-runtime": "^7.6.2",
    "@babel/polyfill": "^7.6.0",
    "@babel/preset-env": "^7.6.3",
    "@babel/register": "^7.7.7",
    "@ember/jquery": "^1.1.0",
    "@ember/optional-features": "^2.0.0",
    "@ember/test-helpers": "^2.2.0",
    "@glimmer/component": "^1.0.3",
    "@glimmer/tracking": "^1.0.3",
    "@wdio/cli": "^5.16.10",
    "@wdio/dot-reporter": "~5.22.4",
    "@wdio/junit-reporter": "~5.22.4",
    "@wdio/local-runner": "~5.22.4",
    "@wdio/mocha-framework": "^5.18.7",
    "@wdio/sauce-service": "^5.22.5",
    "@wdio/selenium-standalone-service": "~5.16.10",
    "@wdio/spec-reporter": "~5.22.4",
    "@wdio/sync": "~5.20.1",
    "autoprefixer": "7.1.6",
    "babel-core": "^6.26.3",
    "babel-eslint": "^10.1.0",
    "babel-plugin-transform-decorators": "6.24.1",
    "babel-plugin-transform-runtime": "6.23.0",
    "babel-preset-es2015": "6.24.1",
    "babel-preset-latest-node6": "0.1.1",
    "babel-register": "6.26.0",
    "babel-runtime": "6.26.0",
    "babelify": "^8.0.0",
    "broccoli-asset-rev": "^3.0.0",
    "broccoli-clean-css": "~1.1.0",
    "browserify": "14.1.0",
    "camelcase": "^5.3.1",
    "chai": "^4.2.0",
    "cross-env": "^5.1.3",
    "cross-spawn": "5.1.0",
    "ember-auto-import": "^1.10.1",
    "ember-cli": "~3.25.1",
    "ember-cli-app-version": "^4.0.0",
    "ember-cli-autoprefixer": "0.8.1",
    "ember-cli-babel": "^7.23.1",
    "ember-cli-chai": "^0.4.0",
    "ember-cli-dependency-checker": "^3.2.0",
    "ember-cli-htmlbars": "^5.3.2",
    "ember-cli-inject-live-reload": "^2.0.2",
    "ember-cli-inline-content": "^0.4.1",
    "ember-cli-mocha": "^0.15.0",
    "ember-cli-node-modules-to-vendor": "^0.3.0",
    "ember-cli-sass": "^6.0.0",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-terser": "^4.0.1",
    "ember-cli-yuidoc": "0.8.8",
    "ember-component-css": "0.5.0",
    "ember-export-application-global": "^2.0.1",
    "ember-fetch": "^8.0.4",
    "ember-intl": "^5.6.2",
    "ember-is-mobile": "^4.1.1",
    "ember-load-initializers": "^2.1.2",
    "ember-maybe-import-regenerator": "^0.1.6",
    "ember-page-title": "^6.2.1",
    "ember-power-calendar": "0.7.1",
    "ember-qunit": "^5.1.2",
    "ember-resolver": "^8.0.2",
    "ember-sinon": "1.0.1",
    "ember-source": "~3.25.1",
    "ember-template-lint": "^2.18.1",
    "eslint": "^7.20.0",
    "eslint-config-airbnb": "17.0.0",
    "eslint-config-airbnb-base": "12.1.0",
    "eslint-config-prettier": "^7.2.0",
    "eslint-plugin-ember": "^10.2.0",
    "eslint-plugin-import": "2.8.0",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-prettier": "^3.3.1",
    "express": "4.16.2",
    "fake-xml-http-request": "^1.6.0",
    "foundation-sites": "^6.3.1",
    "git-rev": "0.2.1",
    "glob": "7.1.2",
    "grunt": "1.0.1",
    "grunt-browserify": "5.2.0",
    "grunt-cli": "^1.2.0",
    "grunt-gitinfo": "0.1.8",
    "grunt-jsonlint": "1.1.0",
    "grunt-run": "0.8.0",
    "grunt-spritesmith": "^6.5.1",
    "grunt-svg-sprite": "^1.3.7",
    "handlebars": "4.0.11",
    "http-proxy": "1.18.1",
    "ismobilejs": "^1.1.1",
    "jquery.cookie": "^1.4.1",
    "libphonenumber-js": "^1.7.26",
    "load-grunt-tasks": "3.5.2",
    "loader.js": "^4.7.0",
    "lodash": "^4.17.12",
    "mkdirp": "0.5.1",
    "mocha": "^4.0.1",
    "moment": "^2.24.0",
    "morgan": "1.9.0",
    "npm-run-all": "^4.1.5",
    "postcss": "6.0.14",
    "pretender": "^1.6.1",
    "prettier": "^2.2.1",
    "q": "^1.5.1",
    "querystring": "0.2.0",
    "qunit": "^2.14.0",
    "qunit-dom": "^1.6.0",
    "request": "2.83.0",
    "route-recognizer": "^0.3.3",
    "rsvp": "4.7.0",
    "sass": "^1.26.3",
    "uri.js": "^0.1.3",
    "webdriverio": "~5.22.1",
    "whatwg-fetch": "^2.0.3",
    "yargs": "10.0.3"
  },
  "engines": {
    "node": "10.* || >= 12"
  },
  "ember": {
    "edition": "octane"
  },
  "resolutions": {
    "kind-of": "^6.0.3",
    "dot-prop": "^5.1.1",
    "minimist": "^1.2.5",
    "handlebars": "^4.6.0",
    "hawk": "^6.0.2",
    "inquirer": "^7.0.0",
    "debug@>=2.0.0 <=2.6.9": "^2.6.9",
    "http-proxy-agent": "^3.0.0",
    "mixin-deep": "^1.3.2",
    "diff": "^3.2.0",
    "set-value": "^2.0.1",
    "ms": "^2.0.0",
    "fstream": "^1.0.12",
    "cryptiles": "^4.1.2",
    "http-signatures": "^1.0.0",
    "lodash.defaultsdeep": "^4.6.1",
    "lodash.merge": "^4.6.2"
  },
  "dependencies": {
    "crypto": "^1.0.1"
  }

Hmm… The package.json showed ember-qunit, qunit, and qunit-dom. If you want to use Mocha, I think you may want to remove these libraries so that Ember CLI may generate test files in Mocha? (There’s chai-dom, which is similar to qunit-dom, I believe.)

I also wonder if you need both ember-cli-mocha and mocha, or if installing ember-mocha is enough, based on https://github.com/emberjs/ember-mocha#installation.

I wonder if I reverted something when I committed my changes to work on other things. I remember ember install ember-mocha installing chai and removing qunit from the package.json file.

Sorry don’t get a lot of time to work on this right now but I did run the install of ember mocha again and it did update the package.json file but still having issues getting tests to run. Just sits there with the open test browser doing nothing. No errors in the console other than SASS compilation warnings about break points and no console errors in the browser.

If I open the sources, the tests are built as is the testem file: image

The only thing I can think of is that there is a disconnect with loading the files in the index.html file. I see the following at the bottom of the compiled file: image

I don’t know if that looks correct or not.

Any other ideas?

What does your tests/test-helper.js look like?

import Application from 'psst/app';
import config from 'psst/config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-mocha';

setApplication(Application.create(config.APP));
start();

Also I went back to my 3.4 branch that I had and the unit tests execute and run on it but now that I am up to 3.26.1 they fail to execute. I won’t say they pass but they do run.

Also I did add console.log statements to test-helper file and they do get triggered in the console. So it is hitting that at least.

Here is the output from ember test if that helps:

git:(ember-upgrade) ✗ ember test
Generating script file for undefined
Generating iFrameRedirect.html file for undefined
Environment: test
⠧ building... [Babel: psst > applyPatches]Warning: ignoring input sourcemap for vendor/libphonenumber-mobile.js because ENOENT: no such file or directory, open '/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/out-269-broccoli_debug_debug_5_vendor_js/vendor/libphonenumber-mobile.js.map'
Warning: ignoring input sourcemap for vendor/moment-with-locales.min.js because ENOENT: no such file or directory, open '/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/out-269-broccoli_debug_debug_5_vendor_js/vendor/moment-with-locales.min.js.map'
Warning: ignoring input sourcemap for vendor/foundation.min.js because ENOENT: no such file or directory, open '/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/out-269-broccoli_debug_debug_5_vendor_js/vendor/foundation.min.js.map'
⠹ building... [SassCompiler]WARNING: breakpoint(): "xsmall" is not defined in your `$breakpoints` or `$breakpoints-hidpi` setting.
         on line 92 of node_modules/foundation-sites/scss/util/_breakpoint.scss, in function `breakpoint`
         from line 152 of node_modules/foundation-sites/scss/util/_breakpoint.scss, in mixin `breakpoint`
         from line 301 of node_modules/foundation-sites/scss/typography/_base.scss, in mixin `foundation-typography-base`
         from line 22 of node_modules/foundation-sites/scss/typography/_typography.scss, in mixin `foundation-typography`
         from line 56 of ../../../../var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/out-247-broccoli_merge_trees_full_application/app/styles/_foundation.scss, in mixin `foundation-everything`
         from line 3 of ../../../../var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/out-247-broccoli_merge_trees_full_application/app/styles/app.scss

⠸ building... [SassCompiler]WARNING: breakpoint(): "xlarge" is not defined in your `$breakpoints` or `$breakpoints-hidpi` setting.
         on line 92 of node_modules/foundation-sites/scss/util/_breakpoint.scss, in function `breakpoint`
         from line 152 of node_modules/foundation-sites/scss/util/_breakpoint.scss, in mixin `breakpoint`
         from line 98 of ../../../../var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/out-247-broccoli_merge_trees_full_application/app/styles/components/page-header/styles.scss
         from line 29 of ../../../../var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/out-247-broccoli_merge_trees_full_application/app/styles/pod-styles.scss
         from line 29 of ../../../../var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/out-247-broccoli_merge_trees_full_application/app/styles/app.scss

Hash: 2d79f61a5357617ec28d
Version: webpack 4.46.0
Time: 3493ms
Built at: 03/26/2021 9:02:44 AM
                                          Asset      Size             Chunks                                Chunk Names
              chunk.app.996b9e8ceeee70282fb3.js  11.4 KiB                app  [emitted] [immutable]         app
            chunk.tests.c4c825c100e7c2e0f86b.js  13.6 KiB              tests  [emitted] [immutable]         tests
      chunk.vendors~app.3235b24bd004a3a8baa6.js   311 KiB        vendors~app  [emitted] [immutable]  [big]  vendors~app
chunk.vendors~app~tests.7ef6e6c6aa54ebd8f5af.js  17.3 KiB  vendors~app~tests  [emitted] [immutable]         vendors~app~tests
    chunk.vendors~tests.7c5dd1c7a7f2d4eb5d11.js  1020 KiB      vendors~tests  [emitted] [immutable]  [big]  vendors~tests
Entrypoint app [big] = chunk.vendors~app~tests.7ef6e6c6aa54ebd8f5af.js chunk.vendors~app.3235b24bd004a3a8baa6.js chunk.app.996b9e8ceeee70282fb3.js
Entrypoint tests [big] = chunk.vendors~app~tests.7ef6e6c6aa54ebd8f5af.js chunk.vendors~tests.7c5dd1c7a7f2d4eb5d11.js chunk.tests.c4c825c100e7c2e0f86b.js
[0] multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/l.js /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/app.js 40 bytes {app} [built]
[2] multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/l.js /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js 40 bytes {tests} [built]
[../../../../private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/app.js] /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/app.js 1.35 KiB {app} [built]
[../../../../private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/l.js] /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/l.js 50 bytes {app} {tests} [built]
[../../../../private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js] /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js 1.16 KiB {tests} [built]
[./node_modules/chai/index.js] 39 bytes {vendors~tests} [built]
[./node_modules/fast-memoize/src/index.js] 2.46 KiB {vendors~app} [built]
[./node_modules/intl-messageformat-parser/lib/index.js] 465 bytes {vendors~app} [built]
[./node_modules/intl-messageformat/lib/index.js] 323 bytes {vendors~app} [built]
[./node_modules/ismobilejs/esm/index.js] 65 bytes {vendors~app} [built]
[./node_modules/lodash.castarray/index.js] 1.56 KiB {vendors~tests} [built]
[./node_modules/lodash.last/index.js] 785 bytes {vendors~tests} [built]
[./node_modules/lodash.omit/index.js] 37.4 KiB {vendors~tests} [built]
[./node_modules/mocha/browser-entry.js] 4.19 KiB {vendors~tests} [built]
[./node_modules/pretender/pretender.js] 16 KiB {vendors~app} [built]
    + 140 hidden modules

WARNING in ./node_modules/mocha/lib/mocha.js 170:20-37
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/mocha/browser-entry.js
 @ /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js
 @ multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/l.js /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js

WARNING in ./node_modules/mocha/lib/mocha.js 175:24-70
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/mocha/browser-entry.js
 @ /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js
 @ multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/l.js /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js

WARNING in ./node_modules/mocha/lib/mocha.js 213:17-30
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/mocha/browser-entry.js
 @ /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js
 @ multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/l.js /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js

WARNING in ./node_modules/mocha/lib/mocha.js 251:26-39
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/mocha/browser-entry.js
 @ /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/tests.js
 @ multi /private/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/broccoli-65860oUHmDrJzUKoG/cache-306-bundler/staging/l.js /private/var/folders/b4/22wprtxxcleaning up...
Built project successfully. Stored in "/var/folders/b4/22wprtxx7m56r98b7n2dj6zdch8bkv/T/tests-dist-2021226-65860-gyxl83.jq8j".
DEPRECATION: Using the `baseURL` setting is deprecated, use `rootURL` instead.

Then it just hangs and sits there.

So have an idea on what is happening. The test files are being found but the load is failing when mocha tries to use require. Basically we have fixtures that we use during some of our testing so we can develop ahead of the server deployments. For this we use pretender and embed that when we make a non production deployment.

So in our sandbox we then create users that have different fixtures. So like for a German user we have a German user and some different data than an American user.

So to do that we add those users to the global object.

global.users = {
  default_user: {
    locale: 'en-US',
  },

But global is not defined and the import then fails. This does not happen in 3.4 but does in 3.26. Not sure if there are any ideas on how to fix this. I tried to create a global object global = {} but that just throws the same error.

Even after changing that the tests are no longer throwing an error on the require part but they are not being run. When you get to the mocha runner, in 3.4 the suite is filled in but in 3.26 the suites are empty. Still debugging. Not sure if there is something in the test setup.

I did notice that in my 3.4, the setupTest('test: component') and in the 3.26 branch it is just setupTest() but even updating them all the tests still fail the updated tests are not there.

So I think I have the unit tests running sort of. Instead of being 0 tests there are two running but they are returning ReferenceError: global is not defined still but I asked about why global cannot be used in Ember Upgrade: global is not defined · Issue #655 · emberjs/ember-mocha · GitHub.

The fix seemed to be removing mocha (not ember-mocha) from package.json. The weird thing is that my 3.4 working branch still had it there but another team that had 3.20 running unit tests did not have it so I removed it and got at least closer.

Have no idea why this fixed things though and I would have never figured that out. I should have over 1600 tests so I am hoping the global thing just caused a bail and that there is not some other reason the tests are not running.

That’s very weird. Thanks for posting all your findings for posterity!