mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 19:54:09 +00:00
test: use lute for tests
This commit is contained in:
parent
72b290219d
commit
a20ee3698a
47 changed files with 190 additions and 236 deletions
|
|
@ -1,11 +1,8 @@
|
|||
local Charm = require("../../Charm")
|
||||
local client = require("../client")
|
||||
local suite = require("../../../../test/suite")
|
||||
local test = require("../../../../tests/test")
|
||||
|
||||
local test = suite.test
|
||||
local afterEach = suite.afterEach
|
||||
|
||||
afterEach(function()
|
||||
test.afterEach(function()
|
||||
client.removeAllSignals()
|
||||
end)
|
||||
|
||||
|
|
@ -2,12 +2,9 @@ local Charm = require("../../Charm")
|
|||
local client = require("../client")
|
||||
local config = require("../config")
|
||||
local server = require("../server")
|
||||
local suite = require("../../../../test/suite")
|
||||
local test = require("../../../../tests/test")
|
||||
|
||||
local afterEach = suite.afterEach
|
||||
local test = suite.test
|
||||
|
||||
afterEach(function()
|
||||
test.afterEach(function()
|
||||
server.reset()
|
||||
client.removeAllSignals()
|
||||
config.preserveHistory = false
|
||||
23
packages/charm-sync/src/__tests__/init.luau
Normal file
23
packages/charm-sync/src/__tests__/init.luau
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
local test = require("../../../tests/test")
|
||||
|
||||
test.describe("client", function()
|
||||
require("@self/client.test")
|
||||
end)
|
||||
|
||||
test.describe("e2e", function()
|
||||
require("@self/e2e.test")
|
||||
end)
|
||||
|
||||
test.describe("utils", function()
|
||||
require("@self/utils.test")
|
||||
end)
|
||||
|
||||
test.describe("patch", function()
|
||||
require("@self/patch.test")
|
||||
end)
|
||||
|
||||
test.describe("server", function()
|
||||
require("@self/server.test")
|
||||
end)
|
||||
|
||||
return {}
|
||||
|
|
@ -1,9 +1,6 @@
|
|||
local config = require("../config")
|
||||
local patch = require("../patch")
|
||||
local suite = require("../../../../test/suite")
|
||||
|
||||
local test = suite.test
|
||||
local afterEach = suite.afterEach
|
||||
local test = require("../../../../tests/test")
|
||||
|
||||
local function mockArraySerdes(object: {}): {}
|
||||
if object[1] then
|
||||
|
|
@ -23,7 +20,7 @@ local function mockArraySerdes(object: {}): {}
|
|||
end
|
||||
end
|
||||
|
||||
afterEach(function()
|
||||
test.afterEach(function()
|
||||
config.fixArrays = true
|
||||
config.validatePatches = true
|
||||
end)
|
||||
|
|
@ -2,14 +2,9 @@ local Charm = require("../../Charm")
|
|||
local config = require("../config")
|
||||
local patch = require("../patch")
|
||||
local server = require("../server")
|
||||
local suite = require("../../../../test/suite")
|
||||
local test = require("../../../../tests/test")
|
||||
|
||||
local afterEach = suite.afterEach
|
||||
local beforeEach = suite.beforeEach
|
||||
local describe = suite.describe
|
||||
local test = suite.test
|
||||
|
||||
afterEach(function()
|
||||
test.afterEach(function()
|
||||
server.reset()
|
||||
end)
|
||||
|
||||
|
|
@ -252,12 +247,12 @@ test("should not send unchanged state", function()
|
|||
assert(#payloads == 0, "Expected no payloads to be sent for unchanged state")
|
||||
end)
|
||||
|
||||
describe("historical", function()
|
||||
beforeEach(function()
|
||||
test.describe("historical", function()
|
||||
test.beforeEach(function()
|
||||
config.preserveHistory = true
|
||||
end)
|
||||
|
||||
afterEach(function()
|
||||
test.afterEach(function()
|
||||
config.preserveHistory = false
|
||||
end)
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
local suite = require("../../../../test/suite")
|
||||
|
||||
suite.describe("client", function()
|
||||
require("./client.spec")
|
||||
end)
|
||||
|
||||
suite.describe("e2e", function()
|
||||
require("./e2e.spec")
|
||||
end)
|
||||
|
||||
suite.describe("utils", function()
|
||||
require("./utils.spec")
|
||||
end)
|
||||
|
||||
suite.describe("patch", function()
|
||||
require("./patch.spec")
|
||||
end)
|
||||
|
||||
suite.describe("server", function()
|
||||
require("./server.spec")
|
||||
end)
|
||||
|
||||
return {}
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
local Charm = require("../../Charm")
|
||||
local suite = require("../../../../test/suite")
|
||||
local test = require("../../../../tests/test")
|
||||
local utils = require("../utils")
|
||||
|
||||
local test = suite.test
|
||||
|
||||
test("should flatten functions", function()
|
||||
local input = {
|
||||
a = Charm.atom(0),
|
||||
Loading…
Add table
Add a link
Reference in a new issue