Skip to content

Commit

Permalink
chore: fixup deprecation-removed test variants (#9677)
Browse files Browse the repository at this point in the history
* chore: fixup TODO tests

* fix todo test
  • Loading branch information
runspired authored Feb 11, 2025
1 parent 4c40f4a commit e9e15c6
Show file tree
Hide file tree
Showing 3 changed files with 419 additions and 189 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function count(label: string) {
globalThis.counts = globalThis.counts || {};
// @ts-expect-error
// eslint-disable-next-line
wglobalThis.counts[label] = (globalThis.counts[label] || 0) + 1;
globalThis.counts[label] = (globalThis.counts[label] || 0) + 1;
}

function _unsubscribe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ import { Type } from '@warp-drive/core-types/symbols';
import type { ReactiveContext } from '../../../helpers/reactive-context';
import { reactiveContext } from '../../../helpers/reactive-context';

let IS_DEPRECATE_MANY_ARRAY_DUPLICATES = false;

if (DEPRECATE_MANY_ARRAY_DUPLICATES) {
IS_DEPRECATE_MANY_ARRAY_DUPLICATES = true;
}

class User extends Model {
@attr declare name: string;
@hasMany('user', { async: false, inverse: 'friends' }) declare friends: ManyArray<User>;
Expand Down Expand Up @@ -222,8 +216,8 @@ async function applyMutation(
const result = generateAppliedMutation(store, record, mutation);
const initialIds = record.friends.map((f) => f.id).join(',');

const shouldError = result.hasDuplicates && !IS_DEPRECATE_MANY_ARRAY_DUPLICATES;
const shouldDeprecate = result.hasDuplicates && IS_DEPRECATE_MANY_ARRAY_DUPLICATES;
const shouldError = result.hasDuplicates && /* inline-macro-config */ !DEPRECATE_MANY_ARRAY_DUPLICATES;
const shouldDeprecate = result.hasDuplicates && /* inline-macro-config */ DEPRECATE_MANY_ARRAY_DUPLICATES;
const expected = shouldError ? result.unchanged : result.deduped;

try {
Expand Down
Loading

0 comments on commit e9e15c6

Please sign in to comment.