A platform for community discussion. Free, open, simple.
DEV: Bump ember-exam and drop patch (#42555)
David Taylorcbd49864806f
diff --git a/frontend/discourse/package.json b/frontend/discourse/package.jsonindex 96b65b918fe..44eb0ee3a2f 100644--- a/frontend/discourse/package.json+++ b/frontend/discourse/package.json@@ -150,7 +150,7 @@"ember-cli": "~7.0.1","ember-cli-deprecation-workflow": "^4.0.1","ember-cli-htmlbars": "^7.0.1",- "ember-exam": "^10.1.0",+ "ember-exam": "^10.1.2","ember-modifier": "^4.3.0","ember-qunit": "^9.0.4","ember-template-imports": "^4.4.0",diff --git a/patches/[email protected] b/patches/[email protected]deleted file mode 100644index d8222f50fbb..00000000000--- a/patches/[email protected]+++ /dev/null@@ -1,70 +0,0 @@-diff --git a/lib/commands/exam.js b/lib/commands/exam.js-index 870d8e4..24f50b4 100644---- a/lib/commands/exam.js-+++ b/lib/commands/exam.js-@@ -325,24 +325,16 @@ module.exports = TestCommand.extend({- );- };--+ // Called for processError, processExit, and the finish() wrapper below.-+ // Flag avoids double-counting.- const browserTerminationHandler = function () {-- // browserTerminationHandler is called for disconnect, processError or processExit events.-- // disconnect and processExit events is fired during global error and successful test runs.-- // On successful test runs, browserExitHandler should already be called. And is unnecessary-- // to call it again, so we should return. This is covered by this.finish = true-- // On global failure cases, it's possible that this.finish is also true. So we must check-- // the timers set by onProcessExit-- // https://github.com/testem/testem/blob/master/lib/runners/browser_test_runner.js#L266-- // or onProcessError in testem.-- // https://github.com/testem/testem/blob/master/lib/runners/browser_test_runner.js#L252-- // If either timers is set, we should record the failed browser and call browserExitHandler-- if (this.finished && !this.onProcessExitTimer && !this.pendingTimer) {-+ if (this._emberExamExitRecorded) {- return;- }-+ this._emberExamExitRecorded = true;- if (commands.get('writeExecutionFile')) {- testemEvents.recordFailedBrowserId(this.launcher, ui);- }--- browserExitHandler.call(this, true);- };--@@ -381,16 +373,31 @@ module.exports = TestCommand.extend({- init = true;- }--+ // Monkey-patch finish() — testem exposes no event for "browser truly-+ // done", and finish() is the one method all termination paths flow-+ // through (clean exit, disconnect timeout, processExit timer). The-+ // socket `disconnect` event fires on transient drops too, so it-+ // can't be used. Microtask defers past after-tests-complete.-+ if (!this._emberExamFinishHooked) {-+ this._emberExamFinishHooked = true;-+ const originalFinish = this.finish;-+ const runner = this;-+ this.finish = function () {-+ const result = originalFinish.apply(this, arguments);-+ Promise.resolve().then(() => browserTerminationHandler.call(runner));-+ return result;-+ };-+ }-+- if (typeof this.launcher !== 'undefined' && this.launcher !== null) {- testemEvents.recordStartedLauncherId(this.launcher.id);- }- };--- events['after-tests-complete'] = browserExitHandler;---- events['disconnect'] = function () {-- // To prevent handling exiting browser browser disconnects from errors `disconnect` callback's needed to be registered.-- browserTerminationHandler.bind(this)();-+ events['after-tests-complete'] = function (...args) {-+ // Mark the runner recorded; the finish() wrapper above checks this flag.-+ this._emberExamExitRecorded = true;-+ return browserExitHandler.apply(this, args);- };-- events['testem:test-done-metadata'] = (details) => {diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 14c13ed9298..52117179986 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -19,9 +19,6 @@ patchedDependencies:ember-buffered-proxy:hash: 6f462c5d8fcc3ebcc27fc038b7be66b9337f0c848ad18e37a2101cb62b29ede5path: patches/ember-buffered-proxy.patch- hash: 1b2f23c19eb9a2a0eb935bfcf98e0a5e9f77d46c41bd1b5c7d12ef4369e067e3- path: patches/[email protected]hash: 85ff9a16d08431e3bdc9aea8d55280e14f437f1c2a7d8e461de56c614ad48926path: patches/[email protected]@@ -575,8 +572,8 @@ importers:specifier: ^7.0.1version: 7.0.1(@babel/[email protected])([email protected](patch_hash=85ff9a16d08431e3bdc9aea8d55280e14f437f1c2a7d8e461de56c614ad48926)(@glimmer/[email protected])([email protected]))ember-exam:- specifier: ^10.1.0- version: 10.1.0(patch_hash=1b2f23c19eb9a2a0eb935bfcf98e0a5e9f77d46c41bd1b5c7d12ef4369e067e3)(@glint/[email protected])([email protected](@babel/[email protected])(@ember/[email protected](@babel/[email protected])(@glint/[email protected]))(@glint/[email protected])([email protected]))([email protected](patch_hash=85ff9a16d08431e3bdc9aea8d55280e14f437f1c2a7d8e461de56c614ad48926)(@glimmer/[email protected])([email protected]))([email protected])+ specifier: ^10.1.2+ version: 10.1.2(@glint/[email protected])([email protected](@babel/[email protected])(@ember/[email protected](@babel/[email protected])(@glint/[email protected]))(@glint/[email protected])([email protected]))([email protected](patch_hash=85ff9a16d08431e3bdc9aea8d55280e14f437f1c2a7d8e461de56c614ad48926)(@glimmer/[email protected])([email protected]))([email protected])ember-modifier:specifier: ^4.3.0version: 4.3.0(@babel/[email protected])@@ -4438,8 +4435,8 @@ packages:resolution: {integrity: sha512-5nItZGzvxHgoCdASQbn9qBzF4sdjSggUeZpXdihAanmYWm6XkObT/TlUvakYtoKret1/8gm0jNLwNPqZYwHtCw==}- resolution: {integrity: sha512-6jUftmu2zpmLZ35PCsZDbdsAXTm2GjCGT3SjRX+BkUr2yKYpbD9B2R7hqCUnqOOTkdp2lzhBcGZ+KwwLLdH7eg==}+ resolution: {integrity: sha512-xm0g10hX7O29sG4yy5SvoF7+fsOsV6aa7Etdn6UxdasxAAFxsR/eV/rUJPraxdfAd3aC06jo1L6MqYaJ0//E0A==}engines: {node: '>= 18'}peerDependencies:ember-qunit: '*'@@ -12803,7 +12800,7 @@ snapshots:content-tag: 4.2.0oxc-parser: 0.130.0- [email protected](patch_hash=1b2f23c19eb9a2a0eb935bfcf98e0a5e9f77d46c41bd1b5c7d12ef4369e067e3)(@glint/[email protected])([email protected](@babel/[email protected])(@ember/[email protected](@babel/[email protected])(@glint/[email protected]))(@glint/[email protected])([email protected]))([email protected](patch_hash=85ff9a16d08431e3bdc9aea8d55280e14f437f1c2a7d8e461de56c614ad48926)(@glimmer/[email protected])([email protected]))([email protected]):+ [email protected](@glint/[email protected])([email protected](@babel/[email protected])(@ember/[email protected](@babel/[email protected])(@glint/[email protected]))(@glint/[email protected])([email protected]))([email protected](patch_hash=85ff9a16d08431e3bdc9aea8d55280e14f437f1c2a7d8e461de56c614ad48926)(@glimmer/[email protected])([email protected]))([email protected]):dependencies:'@babel/core': 7.29.7chalk: 5.6.2diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 43e4a394c3c..32401c3a76d 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -66,7 +66,6 @@ patchedDependencies:"@ember-compat/[email protected]": "patches/@[email protected]""[email protected]": "patches/[email protected]""[email protected]": "patches/[email protected]"- "[email protected]": "patches/[email protected]""message-bus-client": "patches/message-bus-client.patch""ember-buffered-proxy": "patches/ember-buffered-proxy.patch""pikaday": "patches/pikaday.patch"