-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1428 from embroider-build/test-waiters-compat
Add compat adapter for @ember/test-waiters
- Loading branch information
Showing
4 changed files
with
380 additions
and
599 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
packages/compat/src/compat-adapters/@ember/test-waiters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import V1Addon from '../../v1-addon'; | ||
import { satisfies } from 'semver'; | ||
|
||
export default class extends V1Addon { | ||
// our heuristic for detecting tree suppression can't deal with the way | ||
// test-waiters patches treeFor on other copies of its addon instances all | ||
// over the place. It causes us to falsely detect that it's trying to suppress | ||
// all tree output, reducing in empty copies. | ||
protected suppressesTree(_name: string): boolean { | ||
return false; | ||
} | ||
|
||
reduceInstances(instances: V1Addon[]): V1Addon[] { | ||
if (!satisfies(this.packageJSON.version, '>=3.0.2')) { | ||
throw new Error( | ||
`@ember/test-waiters cannot work safely under embroider before version 3.0.2 due to https://github.com/emberjs/ember-test-waiters/pull/388. You have a copy at version ${this.packageJSON.version}.` | ||
); | ||
} | ||
|
||
// we know test waiters tries to dedup itself, so there's no point in building | ||
// and smooshing many copies. | ||
return [instances[0]]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.