Refactor upgrade ember 4 (#1501)
Upgrade Ember 4 Co-authored-by: Randall Morey <randall@randallmorey.com> Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
119 files changed
+1482
-496
No files matched your search
@@ -2,7 +2,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Dummy</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"packages": [
|
||||
{
|
||||
"name": "ember-cli",
|
||||
"version": "3.24.0",
|
||||
"version": "4.4.1",
|
||||
"blueprints": [
|
||||
{
|
||||
"name": "addon",
|
||||
|
||||
@@ -5,7 +5,7 @@ module.exports = function (environment) {
|
||||
modulePrefix: 'dummy',
|
||||
environment,
|
||||
rootURL: '/',
|
||||
locationType: 'auto',
|
||||
locationType: 'history',
|
||||
EmberENV: {
|
||||
FEATURES: {
|
||||
// Here you can enable experimental features on an ember canary build
|
||||
|
||||
@@ -1,22 +1,5 @@
|
||||
export default function () {
|
||||
// These comments are here to help you get started. Feel free to delete them.
|
||||
/*
|
||||
Config (with defaults).
|
||||
import { createServer } from 'miragejs';
|
||||
|
||||
Note: these only affect routes defined *after* them!
|
||||
*/
|
||||
// this.urlPrefix = ''; // make this `http://localhost:8080`, for example, if your API is on a different server
|
||||
// this.namespace = ''; // make this `/api`, for example, if your API is namespaced
|
||||
// this.timing = 400; // delay for each request, automatically set to 0 during testing
|
||||
/*
|
||||
Shorthand cheatsheet:
|
||||
|
||||
this.get('/posts');
|
||||
this.post('/posts');
|
||||
this.get('/posts/:id');
|
||||
this.put('/posts/:id'); // or this.patch
|
||||
this.del('/posts/:id');
|
||||
|
||||
https://www.ember-cli-mirage.com/docs/route-handlers/shorthands
|
||||
*/
|
||||
export default function (config) {
|
||||
return createServer({ ...config });
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
import { JSONAPISerializer } from 'ember-cli-mirage';
|
||||
import { JSONAPISerializer } from 'miragejs';
|
||||
|
||||
export default JSONAPISerializer.extend({});
|
||||
@@ -0,0 +1,42 @@
|
||||
import {
|
||||
setupApplicationTest as upstreamSetupApplicationTest,
|
||||
setupRenderingTest as upstreamSetupRenderingTest,
|
||||
setupTest as upstreamSetupTest,
|
||||
} from 'ember-qunit';
|
||||
|
||||
// This file exists to provide wrappers around ember-qunit's / ember-mocha's
|
||||
// test setup functions. This way, you can easily extend the setup that is
|
||||
// needed per test type.
|
||||
|
||||
function setupApplicationTest(hooks, options) {
|
||||
upstreamSetupApplicationTest(hooks, options);
|
||||
|
||||
// Additional setup for application tests can be done here.
|
||||
//
|
||||
// For example, if you need an authenticated session for each
|
||||
// application test, you could do:
|
||||
//
|
||||
// hooks.beforeEach(async function () {
|
||||
// await authenticateSession(); // ember-simple-auth
|
||||
// });
|
||||
//
|
||||
// This is also a good place to call test setup functions coming
|
||||
// from other addons:
|
||||
//
|
||||
// setupIntl(hooks); // ember-intl
|
||||
// setupMirage(hooks); // ember-cli-mirage
|
||||
}
|
||||
|
||||
function setupRenderingTest(hooks, options) {
|
||||
upstreamSetupRenderingTest(hooks, options);
|
||||
|
||||
// Additional setup for rendering tests can be done here.
|
||||
}
|
||||
|
||||
function setupTest(hooks, options) {
|
||||
upstreamSetupTest(hooks, options);
|
||||
|
||||
// Additional setup for unit tests can be done here.
|
||||
}
|
||||
|
||||
export { setupApplicationTest, setupRenderingTest, setupTest };
|
||||
@@ -2,7 +2,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Dummy Tests</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
@@ -120,10 +120,11 @@ module('Unit | Model | base', function (hooks) {
|
||||
return {};
|
||||
});
|
||||
await model.save();
|
||||
this.server.delete('/v1/users', () => {
|
||||
this.server.delete('/v1/users/u_123', () => {
|
||||
assert.ok(true, 'Correctly scoped delete record URL was requested.');
|
||||
return {};
|
||||
});
|
||||
model.id = 'u_123';
|
||||
await model.destroyRecord();
|
||||
});
|
||||
|
||||
@@ -143,10 +144,11 @@ module('Unit | Model | base', function (hooks) {
|
||||
return {};
|
||||
});
|
||||
await model.save({ adapterOptions: { scopeID: customScopeID } });
|
||||
this.server.delete('/v1/users', () => {
|
||||
this.server.delete('/v1/users/u_123', () => {
|
||||
assert.ok(true, 'Correctly scoped delete record URL was requested.');
|
||||
return {};
|
||||
});
|
||||
model.id = 'u_123';
|
||||
await model.destroyRecord({ adapterOptions: { scopeID: customScopeID } });
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user