-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into trust-tokens-e2e
- Loading branch information
Showing
28 changed files
with
291 additions
and
639 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export const TALLY_INTERNAL_ORIGIN = "@tally-internal" | ||
export const TAHO_INTERNAL_ORIGIN = "@tally-internal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import assert from "assert" | ||
import { diff, patch } from "../differ" | ||
|
||
describe("Diffing & Patching", () => { | ||
describe("BigInts", () => { | ||
const cases = [ | ||
0, | ||
"test", | ||
2n, | ||
{ b: 1 }, | ||
[5], | ||
null, | ||
undefined, | ||
true, | ||
false, | ||
"", | ||
NaN, | ||
] | ||
|
||
test("Creates correct patches when diffing against bigints", () => { | ||
cases.forEach((initial) => { | ||
const expected = 9999n | ||
const delta = diff(initial, expected) | ||
|
||
assert(delta) | ||
expect(patch(initial, delta)).toEqual(expected) | ||
}) | ||
}) | ||
|
||
test("Creates correct patches when diffing from bigints", () => { | ||
cases.forEach((expected) => { | ||
const initial = 9999n | ||
const delta = diff(initial, expected) | ||
|
||
assert(delta) | ||
expect(patch(initial, delta)).toEqual(expected) | ||
}) | ||
}) | ||
|
||
test("Creates correct patches regardless of depth of change", () => { | ||
cases.forEach((expected) => { | ||
const targetFrom = { a: { b: [0, { c: 9999n }] } } | ||
const target = { a: { b: [0, { c: expected }] } } | ||
|
||
const delta = diff(targetFrom, target) | ||
|
||
assert(delta) | ||
|
||
expect(patch(targetFrom, delta)).toEqual(target) | ||
}) | ||
|
||
// against bigints | ||
cases.forEach((initial) => { | ||
const targetFrom = { a: { b: [0, { c: initial }] } } | ||
const target = { a: { b: [0, { c: 9999n }] } } | ||
|
||
const delta = diff(targetFrom, target) | ||
|
||
assert(delta) | ||
|
||
expect(patch(targetFrom, delta)).toEqual(target) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.