Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
Saadnajmi committed Jan 23, 2025
1 parent 20349cf commit 78fd30d
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions packages/dev-middleware/src/__tests__/ResourceUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,24 @@
* @oncall react_native
*/

// [macOS Comment out failing test
// export function withAbortSignalForEachTest(): $ReadOnly<{signal: AbortSignal}> {
// const ref: {signal: AbortSignal} = {
// // $FlowIgnore[unsafe-getters-setters]
// get signal() {
// throw new Error(
// 'The return value of withAbortSignalForEachTest is lazily initialized and can only be accessed in tests.',
// );
// },
// };
// let controller;
// beforeEach(() => {
// controller = new AbortController();
// Object.defineProperty(ref, 'signal', {
// value: controller.signal,
// });
// });
// afterEach(() => {
// controller.abort();
// });
// return ref;
// }
// macOS]
export function withAbortSignalForEachTest(): $ReadOnly<{signal: AbortSignal}> {
const ref: {signal: AbortSignal} = {
// $FlowIgnore[unsafe-getters-setters]
get signal() {
throw new Error(
'The return value of withAbortSignalForEachTest is lazily initialized and can only be accessed in tests.',
);
},
};
let controller;
beforeEach(() => {
controller = new AbortController();
Object.defineProperty(ref, 'signal', {
value: controller.signal,
});
});
afterEach(() => {
controller.abort();
});
return ref;
}

0 comments on commit 78fd30d

Please sign in to comment.