Skip to content

Commit

Permalink
Merge pull request #2575 from mainmatter/test/fix-fastboot-test-setup
Browse files Browse the repository at this point in the history
chore: fix fastboot testing environment for ember-data >= 4.12
  • Loading branch information
BobrImperator authored Jun 24, 2023
2 parents 5b0816c + 05facbf commit 40eb0da
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/test-app/config/fastboot-testing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* global ReadableStream, WritableStream, TransformStream */
module.exports = function() {
return {
buildSandboxGlobals(defaultGlobals) {
return Object.assign({}, defaultGlobals, {
AbortController,
ReadableStream:
typeof ReadableStream !== 'undefined' ? ReadableStream : require('node:stream/web').ReadableStream,
WritableStream:
typeof WritableStream !== 'undefined' ? WritableStream : require('node:stream/web').WritableStream,
TransformStream:
typeof TransformStream !== 'undefined' ? TransformStream : require('node:stream/web').TransformStream,
Headers: typeof Headers !== 'undefined' ? Headers : undefined,
});
},
};
};
17 changes: 17 additions & 0 deletions packages/test-app/config/fastboot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* global ReadableStream, WritableStream, TransformStream */
module.exports = function() {
return {
buildSandboxGlobals(defaultGlobals) {
return Object.assign({}, defaultGlobals, {
AbortController,
ReadableStream:
typeof ReadableStream !== 'undefined' ? ReadableStream : require('node:stream/web').ReadableStream,
WritableStream:
typeof WritableStream !== 'undefined' ? WritableStream : require('node:stream/web').WritableStream,
TransformStream:
typeof TransformStream !== 'undefined' ? TransformStream : require('node:stream/web').TransformStream,
Headers: typeof Headers !== 'undefined' ? Headers : undefined,
});
},
};
};

0 comments on commit 40eb0da

Please sign in to comment.