Skip to content
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

Widen test-waiters range #1524

Merged
merged 11 commits into from
Jan 30, 2025
3 changes: 3 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ jobs:
- name: Build addon
working-directory: addon
run: pnpm build
- name: Force re-sync of injected Dependencies
run: pnpm i -f
- name: Run Tests
working-directory: test-app
run: pnpm test
Expand Down Expand Up @@ -106,6 +108,7 @@ jobs:
- ember-default
- embroider-safe
- embroider-optimized
- "@ember/test-waiters@v4"

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"ember-source": ">= 4.0.0"
},
"dependencies": {
"@ember/test-waiters": "^3.1.0",
"@ember/test-waiters": "^3.1.0 || ^4.0.0",
"@embroider/addon-shim": "^1.8.7",
"@embroider/macros": "^1.16.5",
"@simple-dom/interface": "^1.4.0",
Expand Down
14 changes: 12 additions & 2 deletions addon/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions test-app/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ module.exports = async function () {
},
embroiderSafe(),
embroiderOptimized(),
embroiderOptimized({
name: '@ember/test-waiters@v4',
npm: {
devDependencies: {
'@ember/test-waiters': '^4.0.0',
},
},
}),
],
};
};
3 changes: 2 additions & 1 deletion test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@ember/test-helpers": "workspace:*",
"@embroider/macros": "^1.16.10",
"@embroider/test-setup": "^4.0.0",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
Expand Down Expand Up @@ -74,7 +75,7 @@
"webpack": "^5.78.0"
},
"engines": {
"node": "14.* || 16.* || >= 18"
"node": ">= 18"
},
"ember": {
"edition": "octane"
Expand Down
63 changes: 46 additions & 17 deletions test-app/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 17 additions & 6 deletions test-app/tests/unit/settled-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Ember from 'ember';
import { module, test } from 'qunit';
import { isSettled, getSettledState } from '@ember/test-helpers';
import { macroCondition, dependencySatisfies } from '@embroider/macros';
import { TestDebugInfo } from '@ember/test-helpers/-internal/debug-info';
import hasEmberVersion from '@ember/test-helpers/has-ember-version';
import {
Expand Down Expand Up @@ -418,12 +419,22 @@ module('settled', function (hooks) {
hasPendingTimers: false,
hasRunLoop: false,

// this is true due to
// https://github.com/rwjblue/ember-test-waiters/pull/13 (and
// https://github.com/rwjblue/ember-test-waiters/pull/17), but should
// actually be false once ember-test-waiters drops support for legacy
// waiters (likely quite a while from now)
hasPendingLegacyWaiters: true,
...(macroCondition(
dependencySatisfies('@ember/test-waiters', '>= 4.0.0')
)
? {
hasPendingLegacyWaiters: false,
}
: {
// when using @ember/test-waiters @ v3 or earlier
// this is true due to
// https://github.com/rwjblue/ember-test-waiters/pull/13 (and
// https://github.com/rwjblue/ember-test-waiters/pull/17), but should
// actually be false once ember-test-waiters drops support for legacy
// waiters (likely quite a while from now)

hasPendingLegacyWaiters: true,
}),

hasPendingTestWaiters: true,
hasPendingRequests: false,
Expand Down