Skip to content

Commit 38cf419

Browse files
committed
fix fastboot-testing-app
1 parent 0245602 commit 38cf419

File tree

8 files changed

+21
-5
lines changed

8 files changed

+21
-5
lines changed

packages/ember-cli-fastboot/fastboot/instance-initializers/fetch.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import fetch from 'whatwg-fetch';
2+
3+
window.fetch = fetch;
4+
15
function initialize(instance) {
26
let { request } = instance.lookup('service:fastboot');
37
fetch.__fastbootRequest = request;

packages/ember-cli-fastboot/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"glob": "^7.1.3",
9292
"loader.js": "^4.7.0",
9393
"mocha": "^9.1.2",
94+
"node-fetch": "^2.6.7",
9495
"npm-run-all": "^4.1.5",
9596
"prettier": "^2.5.1",
9697
"qunit": "^2.17.2",
@@ -99,7 +100,8 @@
99100
"release-it-lerna-changelog": "^3.1.0",
100101
"request": "^2.88.0",
101102
"rsvp": "^4.8.3",
102-
"webpack": "^5.58.1"
103+
"webpack": "^5.58.1",
104+
"whatwg-fetch": "^3.0.0"
103105
},
104106
"engines": {
105107
"node": "14.* || 16.* || >=18"

test-packages/basic-app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
"loader.js": "^4.7.0",
6464
"mocha": "^9.1.2",
6565
"npm-run-all": "^4.1.5",
66-
"qunit-dom": "^1.2.0"
66+
"qunit-dom": "^1.2.0",
67+
"whatwg-fetch": "^3.0.0"
6768
},
6869
"fastbootDependencies": [
6970
"rsvp"

test-packages/custom-fastboot-app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
"loader.js": "^4.7.0",
5757
"mocha": "^9.1.2",
5858
"npm-run-all": "^4.1.5",
59-
"qunit-dom": "^1.2.0"
59+
"qunit-dom": "^1.2.0",
60+
"whatwg-fetch": "^3.0.0"
6061
},
6162
"engines": {
6263
"node": "10.* || >= 12"

test-packages/custom-sandbox-app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"eslint-plugin-node": "^11.1.0",
5050
"loader.js": "^4.7.0",
5151
"npm-run-all": "^4.1.5",
52-
"qunit-dom": "^1.2.0"
52+
"qunit-dom": "^1.2.0",
53+
"whatwg-fetch": "^3.0.0"
5354
},
5455
"engines": {
5556
"node": "10.* || >= 12"

test-packages/ember-cli-fastboot-testing-app/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"eslint-plugin-node": "^11.1.0",
5050
"loader.js": "^4.7.0",
5151
"npm-run-all": "^4.1.5",
52-
"qunit-dom": "^1.2.0"
52+
"qunit-dom": "^1.2.0",
53+
"whatwg-fetch": "^3.0.0"
5354
},
5455
"ember": {
5556
"edition": "octane"

test-packages/ember-cli-fastboot-testing-app/tests/index.html

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
{{content-for "body"}}
2222
{{content-for "test-body"}}
2323

24+
<div id="ember-testing"></div>
25+
2426
<script src="/testem.js" integrity=""></script>
2527
<script src="{{rootURL}}assets/vendor.js"></script>
2628
<script src="{{rootURL}}assets/test-support.js"></script>
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import Application from '../app';
22
import config from '../config/environment';
33
import { setApplication } from '@ember/test-helpers';
4+
import * as QUnit from 'qunit';
5+
import { setup } from 'qunit-dom';
46
import { start } from 'ember-qunit';
57

8+
setup(QUnit.assert);
9+
610
setApplication(Application.create(config.APP));
711

812
start();

0 commit comments

Comments
 (0)