Skip to content

Commit

Permalink
Widen test-waiters range (#1524)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
NullVoxPopuli authored Jan 30, 2025
1 parent 279ff47 commit e9045ab
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 27 deletions.
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

0 comments on commit e9045ab

Please sign in to comment.