mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 11:44:08 +00:00
build: update dev config
This commit is contained in:
parent
4b6739c776
commit
8aef95e2ae
3 changed files with 27 additions and 6 deletions
|
|
@ -4,12 +4,11 @@
|
||||||
"$className": "DataModel",
|
"$className": "DataModel",
|
||||||
"ReplicatedStorage": {
|
"ReplicatedStorage": {
|
||||||
"$className": "ReplicatedStorage",
|
"$className": "ReplicatedStorage",
|
||||||
"Packages": {
|
"DevPackages": {
|
||||||
"$path": "Packages",
|
"$path": "DevPackages",
|
||||||
"ReactLua": { "$path": "Packages" },
|
"Charm": { "$path": "src" }
|
||||||
"charm": { "$path": "src" }
|
|
||||||
},
|
},
|
||||||
"DevPackages": { "$path": "DevPackages" }
|
"Packages": { "$path": "Packages" }
|
||||||
},
|
},
|
||||||
"TestService": {
|
"TestService": {
|
||||||
"$className": "TestService",
|
"$className": "TestService",
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,13 @@ return function()
|
||||||
local previous = a()
|
local previous = a()
|
||||||
local client = sync.client({ atoms = { a = a } })
|
local client = sync.client({ atoms = { a = a } })
|
||||||
|
|
||||||
|
client:sync({
|
||||||
|
type = "init",
|
||||||
|
data = { a = a() },
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(a()).to.equal(previous)
|
||||||
|
|
||||||
client:sync({
|
client:sync({
|
||||||
type = "patch",
|
type = "patch",
|
||||||
data = { a = { b = 3 } },
|
data = { a = { b = 3 } },
|
||||||
|
|
@ -34,6 +41,11 @@ return function()
|
||||||
local a = atom({ 1 })
|
local a = atom({ 1 })
|
||||||
local client = sync.client({ atoms = { a = a } })
|
local client = sync.client({ atoms = { a = a } })
|
||||||
|
|
||||||
|
client:sync({
|
||||||
|
type = "init",
|
||||||
|
data = { a = a() },
|
||||||
|
})
|
||||||
|
|
||||||
-- This patch would be the result of a diff between { 1 } and { 1, 2 } that
|
-- This patch would be the result of a diff between { 1 } and { 1, 2 } that
|
||||||
-- was JSON-serialized and deserialized. The client should be able to catch
|
-- was JSON-serialized and deserialized. The client should be able to catch
|
||||||
-- this and convert the string key back to a number.
|
-- this and convert the string key back to a number.
|
||||||
|
|
@ -55,6 +67,11 @@ return function()
|
||||||
table.insert(calls, value)
|
table.insert(calls, value)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
client:sync({
|
||||||
|
type = "init",
|
||||||
|
data = { a = a() },
|
||||||
|
})
|
||||||
|
|
||||||
client:sync({
|
client:sync({
|
||||||
type = "patch",
|
type = "patch",
|
||||||
data = { a = 2 },
|
data = { a = 2 },
|
||||||
|
|
@ -82,6 +99,11 @@ return function()
|
||||||
states.a = a()
|
states.a = a()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
client:sync({
|
||||||
|
type = "init",
|
||||||
|
data = { a = a(), b = b() },
|
||||||
|
})
|
||||||
|
|
||||||
client:sync({
|
client:sync({
|
||||||
type = "patch",
|
type = "patch",
|
||||||
data = { a = 1, b = 2 },
|
data = { a = 1, b = 2 },
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
roots = ["ReplicatedStorage/Packages/charm/__tests__"]
|
roots = ["ReplicatedStorage/DevPackages/Charm/__tests__"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue