Skip to content

Commit e9045ab

Browse files
Widen test-waiters range (#1524)
* Widen test-waiters range * Add try scenario * Re-roll lockfile. Don't lie about the test-app's expected node version * Force re-sync * What about an override? * Revert "What about an override?" This reverts commit f9ca7dd. * A test needed to be updated * Add @embroider/macros to the test-app * Reduce lockfile changes * Revert "Force re-sync" This reverts commit 063919b. * Only the floating test needs the -f
1 parent 279ff47 commit e9045ab

File tree

7 files changed

+89
-27
lines changed

7 files changed

+89
-27
lines changed

.github/workflows/ci-build.yml

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ jobs:
7979
- name: Build addon
8080
working-directory: addon
8181
run: pnpm build
82+
- name: Force re-sync of injected Dependencies
83+
run: pnpm i -f
8284
- name: Run Tests
8385
working-directory: test-app
8486
run: pnpm test
@@ -106,6 +108,7 @@ jobs:
106108
- ember-default
107109
- embroider-safe
108110
- embroider-optimized
111+
- "@ember/test-waiters@v4"
109112

110113
steps:
111114
- uses: actions/checkout@v4

addon/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"ember-source": ">= 4.0.0"
5252
},
5353
"dependencies": {
54-
"@ember/test-waiters": "^3.1.0",
54+
"@ember/test-waiters": "^3.1.0 || ^4.0.0",
5555
"@embroider/addon-shim": "^1.8.7",
5656
"@embroider/macros": "^1.16.5",
5757
"@simple-dom/interface": "^1.4.0",

addon/pnpm-lock.yaml

+12-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-app/config/ember-try.js

+8
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ module.exports = async function () {
123123
},
124124
embroiderSafe(),
125125
embroiderOptimized(),
126+
embroiderOptimized({
127+
name: '@ember/test-waiters@v4',
128+
npm: {
129+
devDependencies: {
130+
'@ember/test-waiters': '^4.0.0',
131+
},
132+
},
133+
}),
126134
],
127135
};
128136
};

test-app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@ember/optional-features": "^2.0.0",
3636
"@ember/string": "^3.0.1",
3737
"@ember/test-helpers": "workspace:*",
38+
"@embroider/macros": "^1.16.10",
3839
"@embroider/test-setup": "^4.0.0",
3940
"@glimmer/component": "^1.1.2",
4041
"@glimmer/tracking": "^1.1.2",
@@ -74,7 +75,7 @@
7475
"webpack": "^5.78.0"
7576
},
7677
"engines": {
77-
"node": "14.* || 16.* || >= 18"
78+
"node": ">= 18"
7879
},
7980
"ember": {
8081
"edition": "octane"

test-app/pnpm-lock.yaml

+46-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-app/tests/unit/settled-test.js

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Ember from 'ember';
22
import { module, test } from 'qunit';
33
import { isSettled, getSettledState } from '@ember/test-helpers';
4+
import { macroCondition, dependencySatisfies } from '@embroider/macros';
45
import { TestDebugInfo } from '@ember/test-helpers/-internal/debug-info';
56
import hasEmberVersion from '@ember/test-helpers/has-ember-version';
67
import {
@@ -418,12 +419,22 @@ module('settled', function (hooks) {
418419
hasPendingTimers: false,
419420
hasRunLoop: false,
420421

421-
// this is true due to
422-
// https://github.com/rwjblue/ember-test-waiters/pull/13 (and
423-
// https://github.com/rwjblue/ember-test-waiters/pull/17), but should
424-
// actually be false once ember-test-waiters drops support for legacy
425-
// waiters (likely quite a while from now)
426-
hasPendingLegacyWaiters: true,
422+
...(macroCondition(
423+
dependencySatisfies('@ember/test-waiters', '>= 4.0.0')
424+
)
425+
? {
426+
hasPendingLegacyWaiters: false,
427+
}
428+
: {
429+
// when using @ember/test-waiters @ v3 or earlier
430+
// this is true due to
431+
// https://github.com/rwjblue/ember-test-waiters/pull/13 (and
432+
// https://github.com/rwjblue/ember-test-waiters/pull/17), but should
433+
// actually be false once ember-test-waiters drops support for legacy
434+
// waiters (likely quite a while from now)
435+
436+
hasPendingLegacyWaiters: true,
437+
}),
427438

428439
hasPendingTestWaiters: true,
429440
hasPendingRequests: false,

0 commit comments

Comments
 (0)