-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require explicit calls to loadTests and setupEmberOnerrorValidation #1182
Conversation
|
could we do something like: // ... ope.js
export const state = {
requiresLoadTestsProbably : Boolean(globalThis.require),
didNotLoadAMDTests: true,
}
export function setNeedToError(x) { state.didNotLoadAMDTests = x; }
// ... load-tests.js
import { setNeedToError } from './ope.js';
function loadTests() {
setNeedToError(false);
}
// ... index.js
import { state } from './ope.js';
export function start() {
if (state.requiresLoadTestsProbably && state.didNotLoadAMDTests) {
throw new Error("loadTests() is needed!")
}
} |
We have a [pending breaking change in ember-qunit](emberjs/ember-qunit#1182) that would become ember-qunit 9.0.0. I'm opening this draft PR so people can review what the impact would be on the blueprint.
We have a [pending breaking change in ember-qunit](emberjs/ember-qunit#1182) that would become ember-qunit 9.0.0. I'm opening this draft PR so people can review what the impact would be on the blueprint.
We have a [pending breaking change in ember-qunit](emberjs/ember-qunit#1182) that would become ember-qunit 9.0.0. I'm opening this draft PR so people can review what the impact would be on the blueprint.
is this still compatible with ember-exam? or is it planned to update ember-exam to account for these changes? |
It looks like ember-exam was already using which is now the default behavior, so I don't think this breaks anything that was working before. |
We have a [pending breaking change in ember-qunit](emberjs/ember-qunit#1182) that would become ember-qunit 9.0.0. I'm opening this draft PR so people can review what the impact would be on the blueprint.
then I'm doing something wrong in rust-lang/crates.io#10241 😅 |
I think that PR is accidentally replacing |
that's essentially what's happening in https://github.com/ember-cli/ember-exam/blob/main/addon-test-support/start.js, but it doesnt seem to work. I have a feeling that in https://github.com/ember-cli/ember-exam/blob/main/addon-test-support/-private/ember-exam-test-loader.js#L16 it fails to load the parent class 🤔 |
Ah, so yes, there's no exported But also: the PR definitely does include a mistake about which start it's calling. I will review over there. |
seems to have worked. thanks for the fast reply! :) |
This makes
start
fromember-qunit
really only responsible for starting tests, and splits test loading intoloadTests()
and the classical onError validation intosetupEmberOnerrorValidation
. It's necessary because test loading is a classic AMD concept that's not wanted in new-style apps building with Embroider. Also we want to drop the dependency on ember-cli-test-loader because that is a v1 addon.To keep the classic behavior, the blueprint will change like:
Note that
setupEmberOnerrorValidation
was already an exported function, it was just missing a type declaration. We decided to drop this from happening automatically because it protects people during this upgrade: if they don't change their blueprint at all, they will get a failing test suite with no tests in it. Had we kept the automatic OnError validation, the presence of that test would cause a spurious passing test suite when you fail to callloadTests()
.This is still draft because we need to confirm the TS support in some real apps both with and withoutI tested this under both moduleResolution modes.moduleResolution: "nodenext"
.