Skip to content

Commit

Permalink
54 failures to go
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Mar 18, 2023
1 parent adea82c commit 9650d19
Show file tree
Hide file tree
Showing 29 changed files with 16 additions and 128 deletions.
3 changes: 2 additions & 1 deletion packages/-ember-data/addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ import JSONSerializer from '@ember-data/serializer/json';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
import Transform from '@ember-data/serializer/transform';
import Store, { normalizeModelName } from '@ember-data/store';
import { normalizeModelName } from '@ember-data/store';

import {
DS,
Expand All @@ -197,6 +197,7 @@ import {
PromiseObject,
RecordArrayManager,
Snapshot,
Store,
} from './-private';
import setupContainer from './setup-container';

Expand Down
6 changes: 5 additions & 1 deletion packages/request/src/-private/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ export function deepFreeze<T = unknown>(value: T): T {
return value;
case 'object':
Object.keys(value as {}).forEach((key) => {
(value as {})[key] = deepFreeze((value as {})[key]) as {};
try {
(value as {})[key] = deepFreeze((value as {})[key]) as {};
} catch {
// continue
}
});
value[IS_FROZEN] = true;
return Object.freeze(value);
Expand Down
1 change: 1 addition & 0 deletions packages/store/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default {
'@embroider/macros',
'@glimmer/tracking',

'@ember-data/legacy-compat/-private',
'@ember-data/tracking/-private',
'@ember-data/private-build-infra/deprecations',
'@ember/-internals/metal',
Expand Down
1 change: 1 addition & 0 deletions tests/main/app/services/store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-data/store';
3 changes: 1 addition & 2 deletions tests/main/tests/acceptance/relationships/belongs-to-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import JSONAPIAdapter from '@ember-data/adapter/json-api';
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import { LEGACY_SUPPORT } from '@ember-data/model/-private';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import Store, { recordIdentifierFor } from '@ember-data/store';
import { recordIdentifierFor } from '@ember-data/store';

import { implicitRelationshipsFor } from '../../helpers/accessors';

Expand Down Expand Up @@ -228,7 +228,6 @@ module('async belongs-to rendering tests', function (hooks) {
},
})
);
owner.register('service:store', Store);
store = owner.lookup('service:store');
adapter = store.adapterFor('application');
});
Expand Down
3 changes: 0 additions & 3 deletions tests/main/tests/acceptance/relationships/has-many-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import { LEGACY_SUPPORT } from '@ember-data/model/-private';
import { DEPRECATE_ARRAY_LIKE } from '@ember-data/private-build-infra/deprecations';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import Store from '@ember-data/store';
import { deprecatedTest } from '@ember-data/unpublished-test-infra/test-support/deprecated-test';

class Person extends Model {
Expand Down Expand Up @@ -207,7 +206,6 @@ module('async has-many rendering tests', function (hooks) {
owner.register('model:person', Person);
owner.register('adapter:application', TestAdapter);
owner.register('serializer:application', JSONAPISerializer);
owner.register('service:store', Store);
store = owner.lookup('service:store');
adapter = store.adapterFor('application');
});
Expand Down Expand Up @@ -694,7 +692,6 @@ module('autotracking has-many', function (hooks) {
owner.register('model:person', Person);
owner.register('adapter:application', TestAdapter);
owner.register('serializer:application', JSONAPISerializer);
owner.register('service:store', Store);
store = owner.lookup('service:store');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { resolve } from 'rsvp';
import { setupRenderingTest } from 'ember-qunit';

import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import Store from '@ember-data/store';

class Tag {
@tracked rev = 0;
Expand All @@ -20,10 +19,6 @@ class Tag {
module('tracking state flags on a record', function (hooks) {
setupRenderingTest(hooks);

hooks.beforeEach(function () {
this.owner.register('service:store', Store);
});

function resolveAsync(initializer) {
return function (target, key, desc) {
const tag = new Tag();
Expand Down
2 changes: 0 additions & 2 deletions tests/main/tests/acceptance/tracking-model-id-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { setupRenderingTest } from 'ember-qunit';
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import Model, { attr } from '@ember-data/model';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import Store from '@ember-data/store';

class Widget extends Model {
@attr() name;
Expand Down Expand Up @@ -60,7 +59,6 @@ module('acceptance/tracking-model-id - tracking model id', function (hooks) {

hooks.beforeEach(function () {
let { owner } = this;
owner.register('service:store', Store);
owner.register('model:widget', Widget);
owner.register('component:widget-list', WidgetList);
owner.register('template:components/widget-list', layout);
Expand Down
2 changes: 0 additions & 2 deletions tests/main/tests/acceptance/tracking-promise-flags-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { setupRenderingTest } from 'ember-qunit';

import JSONAPIAdapter from '@ember-data/adapter/json-api';
import Model, { attr } from '@ember-data/model';
import Store from '@ember-data/store';
import { deprecatedTest } from '@ember-data/unpublished-test-infra/test-support/deprecated-test';

class Widget extends Model {
Expand All @@ -19,7 +18,6 @@ module('acceptance/tracking-promise-flags', function (hooks) {

hooks.beforeEach(function () {
let { owner } = this;
owner.register('service:store', Store);
owner.register('model:widget', Widget);
owner.register(
'serializer:application',
Expand Down
2 changes: 0 additions & 2 deletions tests/main/tests/integration/identifiers/cache-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import { module, test } from 'qunit';

import { setupTest } from 'ember-qunit';

import Store from '@ember-data/store';
import testInDebug from '@ember-data/unpublished-test-infra/test-support/test-in-debug';

module('Integration | Identifiers - cache', function (hooks) {
setupTest(hooks);
let store, cache;

hooks.beforeEach(function () {
this.owner.register(`service:store`, Store);
store = this.owner.lookup('service:store');
cache = store.identifierCache;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module('Integration | Identifiers - configuration', function (hooks) {
}

owner.register('model:user', User);
owner.register('service:store', Store);

let localIdInc = 9000;
const generationMethod = (resource: ResourceData | { type: string }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { setupTest } from 'ember-qunit';

import Adapter from '@ember-data/adapter';
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import Store, { recordIdentifierFor } from '@ember-data/store';
import { recordIdentifierFor } from '@ember-data/store';
import type { Snapshot } from '@ember-data/store/-private';

module('Integration | Identifiers - lid reflection', function (hooks: NestedHooks) {
Expand All @@ -16,7 +16,6 @@ module('Integration | Identifiers - lid reflection', function (hooks: NestedHook

hooks.beforeEach(function () {
const { owner } = this;
owner.register(`service:store`, Store);

class User extends Model {
@attr declare name: string;
Expand Down
3 changes: 1 addition & 2 deletions tests/main/tests/integration/identifiers/new-records-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

import Model, { attr } from '@ember-data/model';
import Store, { recordIdentifierFor } from '@ember-data/store';
import { recordIdentifierFor } from '@ember-data/store';

module('Integration | Identifiers - creating new records', function (hooks) {
setupTest(hooks);
let store;

hooks.beforeEach(function () {
const { owner } = this;
owner.register(`service:store`, Store);

class User extends Model {
@attr() name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { setupTest } from 'ember-qunit';

import Adapter from '@ember-data/adapter';
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import Store from '@ember-data/store';

type RID = { type: string; id: string };

Expand Down Expand Up @@ -61,7 +60,6 @@ module('Integration | Identifiers - single-table-inheritance polymorphic scenari
owner.register('model:ferrari', Ferrari);
owner.register('model:bmw', Bmw);
owner.register('model:dealership', Dealership);
owner.register('service:store', Store);

store = owner.lookup('service:store');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import { setupTest } from 'ember-qunit';

import Adapter from '@ember-data/adapter';
import Model, { attr } from '@ember-data/model';
import Store, { recordIdentifierFor } from '@ember-data/store';
import { recordIdentifierFor } from '@ember-data/store';

module('Integration | Identifiers - recordIdentifierFor', function (hooks) {
setupTest(hooks);
let store;

hooks.beforeEach(function () {
const { owner } = this;
owner.register(`service:store`, Store);

class User extends Model {
@attr() name;
Expand Down
4 changes: 2 additions & 2 deletions tests/main/tests/integration/identifiers/scenarios-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { setupTest } from 'ember-qunit';

import Adapter from '@ember-data/adapter';
import Model, { attr } from '@ember-data/model';
import Store, {
import type Store from '@ember-data/store';
import {
recordIdentifierFor,
setIdentifierForgetMethod,
setIdentifierGenerationMethod,
Expand Down Expand Up @@ -293,7 +294,6 @@ module('Integration | Identifiers - scenarios', function (hooks) {
owner.register('adapter:application', TestAdapter);
owner.register('serializer:application', TestSerializer);
owner.register('model:user', User);
owner.register('service:store', Store);

calls = {
findRecord: 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/main/tests/integration/multiple-stores-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// because the ember-data/store uses DefaultRecordData while @ember-data/store does not
import { module, test } from 'qunit';

import Store from 'ember-data/store';
import { setupTest } from 'ember-qunit';

import Adapter from '@ember-data/adapter';
import RESTAdapter from '@ember-data/adapter/rest';
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
import Store from '@ember-data/store';

module('integration/multiple_stores - Multiple Stores Tests', function (hooks) {
setupTest(hooks);
Expand Down
2 changes: 0 additions & 2 deletions tests/main/tests/integration/records/create-record-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { setupTest } from 'ember-qunit';
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import Store from '@ember-data/store';

class Person extends Model {
@hasMany('pet', { inverse: 'owner', async: false })
Expand All @@ -34,7 +33,6 @@ module('Store.createRecord() coverage', function (hooks) {

hooks.beforeEach(function () {
let { owner } = this;
owner.register('service:store', Store);
owner.register('model:person', Person);
owner.register('model:pet', Pet);
store = owner.lookup('service:store');
Expand Down
2 changes: 0 additions & 2 deletions tests/main/tests/integration/records/edit-record-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import Store from '@ember-data/store';

class Person extends Model {
@hasMany('pet', { inverse: 'owner', async: false })
Expand All @@ -29,7 +28,6 @@ module('Editing a Record', function (hooks) {

hooks.beforeEach(function () {
let { owner } = this;
owner.register('service:store', Store);
owner.register('model:person', Person);
owner.register('model:pet', Pet);
store = owner.lookup('service:store');
Expand Down
2 changes: 0 additions & 2 deletions tests/main/tests/integration/records/load-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { setupTest } from 'ember-qunit';
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import Model, { attr, belongsTo } from '@ember-data/model';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import Store from '@ember-data/store';
import testInDebug from '@ember-data/unpublished-test-infra/test-support/test-in-debug';

function _isLoading(cache, identifier) {
Expand Down Expand Up @@ -39,7 +38,6 @@ module('integration/load - Loading Records', function (hooks) {

hooks.beforeEach(function () {
let { owner } = this;
owner.register('service:store', Store);
owner.register('model:person', Person);
store = owner.lookup('service:store');
});
Expand Down
2 changes: 0 additions & 2 deletions tests/main/tests/integration/records/reload-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { setupTest } from 'ember-qunit';
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import Store from '@ember-data/store';

module('integration/reload - Reloading Records', function (hooks) {
let store;
Expand All @@ -27,7 +26,6 @@ module('integration/reload - Reloading Records', function (hooks) {
}

let { owner } = this;
owner.register('service:store', Store);
owner.register('model:person', Person);
owner.register(
'serializer:application',
Expand Down
2 changes: 0 additions & 2 deletions tests/main/tests/integration/relationships/belongs-to-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { setupTest } from 'ember-qunit';
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import Store from '@ember-data/store';
import { deprecatedTest } from '@ember-data/unpublished-test-infra/test-support/deprecated-test';
import testInDebug from '@ember-data/unpublished-test-infra/test-support/test-in-debug';

Expand All @@ -34,7 +33,6 @@ module('integration/relationship/belongs-to BelongsTo Relationships (new-style)'

hooks.beforeEach(function () {
let { owner } = this;
owner.register('service:store', Store);
owner.register('model:person', Person);
owner.register('model:pet', Pet);
owner.register(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { setupTest } from 'ember-qunit';
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';
import JSONAPISerializer from '@ember-data/serializer/json-api';
import Store from '@ember-data/store';
import { deprecatedTest } from '@ember-data/unpublished-test-infra/test-support/deprecated-test';

module('inverse relationship load test', function (hooks) {
Expand All @@ -15,7 +14,6 @@ module('inverse relationship load test', function (hooks) {

hooks.beforeEach(function () {
let { owner } = this;
owner.register('service:store', Store);
store = owner.lookup('service:store');
owner.register(
'serializer:application',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import { resolve } from 'rsvp';
import { setupTest } from 'ember-qunit';

import Model, { attr, hasMany } from '@ember-data/model';
import Store from '@ember-data/store';

module('JSON:API links access on relationships', function (hooks) {
setupTest(hooks);
let store;

hooks.beforeEach(function () {
const { owner } = this;
owner.register('service:store', Store);
store = owner.lookup('service:store');
});

Expand Down
2 changes: 0 additions & 2 deletions tests/main/tests/integration/store/model-name-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

import Model, { attr } from '@ember-data/model';
import Store from '@ember-data/store';

function startsWith(str, substr) {
if (typeof str.startsWith === 'function') {
Expand Down Expand Up @@ -37,7 +36,6 @@ module('@ember-data/model klass.modelName', function (hooks) {
owner.register('model:animal', Animal);
owner.register('model:pet', Pet);
owner.register('service:animal-helper', AnimalHelper);
owner.register('sercice:store', Store);
const store = owner.lookup('service:store');
const animalHelper = owner.lookup('service:animal-helper');

Expand Down
Loading

0 comments on commit 9650d19

Please sign in to comment.