mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Late scripts require in tests
This commit is contained in:
parent
3219b280e7
commit
2d8d3cffbb
@ -3,8 +3,8 @@ local deftest = require("deftest.deftest")
|
|||||||
local tests = {
|
local tests = {
|
||||||
-- Test list
|
-- Test list
|
||||||
require("test.tests.test_button"),
|
require("test.tests.test_button"),
|
||||||
--require("test.tests.test_hover"),
|
require("test.tests.test_hover"),
|
||||||
--require("test.tests.test_drag"),
|
require("test.tests.test_drag"),
|
||||||
require("test.tests.test_back_handler"),
|
require("test.tests.test_back_handler"),
|
||||||
require("test.tests.test_blocker"),
|
require("test.tests.test_blocker"),
|
||||||
--require("test.tests.test_static_grid"),
|
--require("test.tests.test_static_grid"),
|
||||||
|
@ -7,6 +7,7 @@ return function()
|
|||||||
|
|
||||||
local druid = nil
|
local druid = nil
|
||||||
local context = nil
|
local context = nil
|
||||||
|
|
||||||
describe("Back Handler component", function()
|
describe("Back Handler component", function()
|
||||||
before(function()
|
before(function()
|
||||||
mock_gui = require("deftest.mock.gui")
|
mock_gui = require("deftest.mock.gui")
|
||||||
@ -18,6 +19,7 @@ return function()
|
|||||||
mock_gui.mock()
|
mock_gui.mock()
|
||||||
mock_time.mock()
|
mock_time.mock()
|
||||||
mock_time.set(60)
|
mock_time.set(60)
|
||||||
|
|
||||||
context = test_helper.get_context()
|
context = test_helper.get_context()
|
||||||
druid = druid_system.new(context)
|
druid = druid_system.new(context)
|
||||||
end)
|
end)
|
||||||
|
@ -7,6 +7,7 @@ return function()
|
|||||||
|
|
||||||
local druid = nil
|
local druid = nil
|
||||||
local context = nil
|
local context = nil
|
||||||
|
|
||||||
describe("Blocker component", function()
|
describe("Blocker component", function()
|
||||||
before(function()
|
before(function()
|
||||||
mock_gui = require("deftest.mock.gui")
|
mock_gui = require("deftest.mock.gui")
|
||||||
@ -18,6 +19,7 @@ return function()
|
|||||||
mock_gui.mock()
|
mock_gui.mock()
|
||||||
mock_time.mock()
|
mock_time.mock()
|
||||||
mock_time.set(60)
|
mock_time.set(60)
|
||||||
|
|
||||||
context = test_helper.get_context()
|
context = test_helper.get_context()
|
||||||
druid = druid_system.new(context)
|
druid = druid_system.new(context)
|
||||||
end)
|
end)
|
||||||
|
@ -7,6 +7,7 @@ return function()
|
|||||||
|
|
||||||
local druid = nil
|
local druid = nil
|
||||||
local context = nil
|
local context = nil
|
||||||
|
|
||||||
describe("Button Component", function()
|
describe("Button Component", function()
|
||||||
before(function()
|
before(function()
|
||||||
mock_gui = require("deftest.mock.gui")
|
mock_gui = require("deftest.mock.gui")
|
||||||
@ -18,6 +19,7 @@ return function()
|
|||||||
mock_gui.mock()
|
mock_gui.mock()
|
||||||
mock_time.mock()
|
mock_time.mock()
|
||||||
mock_time.set(60)
|
mock_time.set(60)
|
||||||
|
|
||||||
context = test_helper.get_context()
|
context = test_helper.get_context()
|
||||||
druid = druid_system.new(context)
|
druid = druid_system.new(context)
|
||||||
end)
|
end)
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
return function()
|
return function()
|
||||||
local mock_gui = require "deftest.mock.gui"
|
local mock_gui = nil
|
||||||
local mock_time = require("deftest.mock.time")
|
local mock_time = nil
|
||||||
local mock_input = require("test.helper.mock_input")
|
local mock_input = nil
|
||||||
local test_helper = require("test.helper.test_helper")
|
local test_helper = nil
|
||||||
local druid_system = require("druid.druid")
|
local druid_system = nil
|
||||||
|
|
||||||
local druid = nil
|
local druid = nil
|
||||||
local context = test_helper.get_context()
|
local context = nil
|
||||||
|
|
||||||
local function create_drag_instance(on_drag)
|
local function create_drag_instance(on_drag)
|
||||||
local button = mock_gui.add_box("button", 0, 0, 20, 20)
|
local button = mock_gui.add_box("button", 0, 0, 20, 20)
|
||||||
@ -18,9 +18,17 @@ return function()
|
|||||||
|
|
||||||
describe("Drag component", function()
|
describe("Drag component", function()
|
||||||
before(function()
|
before(function()
|
||||||
|
mock_gui = require("deftest.mock.gui")
|
||||||
|
mock_time = require("deftest.mock.time")
|
||||||
|
mock_input = require("test.helper.mock_input")
|
||||||
|
test_helper = require("test.helper.test_helper")
|
||||||
|
druid_system = require("druid.druid")
|
||||||
|
|
||||||
mock_gui.mock()
|
mock_gui.mock()
|
||||||
mock_time.mock()
|
mock_time.mock()
|
||||||
mock_time.set(60)
|
mock_time.set(60)
|
||||||
|
|
||||||
|
context = test_helper.get_context()
|
||||||
druid = druid_system.new(context)
|
druid = druid_system.new(context)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -1,17 +1,26 @@
|
|||||||
return function()
|
return function()
|
||||||
local mock_gui = require "deftest.mock.gui"
|
local mock_gui = nil
|
||||||
local mock_time = require("deftest.mock.time")
|
local mock_time = nil
|
||||||
local mock_input = require("test.helper.mock_input")
|
local mock_input = nil
|
||||||
local test_helper = require("test.helper.test_helper")
|
local test_helper = nil
|
||||||
local druid_system = require("druid.druid")
|
local druid_system = nil
|
||||||
|
|
||||||
local druid = nil
|
local druid = nil
|
||||||
local context = test_helper.get_context()
|
local context = nil
|
||||||
|
|
||||||
describe("Hover component", function()
|
describe("Hover component", function()
|
||||||
before(function()
|
before(function()
|
||||||
|
mock_gui = require("deftest.mock.gui")
|
||||||
|
mock_time = require("deftest.mock.time")
|
||||||
|
mock_input = require("test.helper.mock_input")
|
||||||
|
test_helper = require("test.helper.test_helper")
|
||||||
|
druid_system = require("druid.druid")
|
||||||
|
|
||||||
mock_gui.mock()
|
mock_gui.mock()
|
||||||
mock_time.mock()
|
mock_time.mock()
|
||||||
mock_time.set(60)
|
mock_time.set(60)
|
||||||
|
|
||||||
|
context = test_helper.get_context()
|
||||||
druid = druid_system.new(context)
|
druid = druid_system.new(context)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
return function()
|
return function()
|
||||||
local mock_gui = require "deftest.mock.gui"
|
local mock_gui = nil
|
||||||
local mock_time = require("deftest.mock.time")
|
local mock_time = nil
|
||||||
local mock_input = require("test.helper.mock_input")
|
local mock_input = nil
|
||||||
local test_helper = require("test.helper.test_helper")
|
local test_helper = nil
|
||||||
local druid_system = require("druid.druid")
|
local druid_system = nil
|
||||||
|
|
||||||
local druid = nil
|
local druid = nil
|
||||||
local context = test_helper.get_context()
|
local context = nil
|
||||||
|
|
||||||
describe("Static Grid component", function()
|
describe("Static Grid component", function()
|
||||||
local parent = nil
|
local parent = nil
|
||||||
---@type druid.static_grid
|
---@type druid.static_grid
|
||||||
@ -14,9 +15,17 @@ return function()
|
|||||||
local prefab = nil
|
local prefab = nil
|
||||||
|
|
||||||
before(function()
|
before(function()
|
||||||
|
mock_gui = require("deftest.mock.gui")
|
||||||
|
mock_time = require("deftest.mock.time")
|
||||||
|
mock_input = require("test.helper.mock_input")
|
||||||
|
test_helper = require("test.helper.test_helper")
|
||||||
|
druid_system = require("druid.druid")
|
||||||
|
|
||||||
mock_gui.mock()
|
mock_gui.mock()
|
||||||
mock_time.mock()
|
mock_time.mock()
|
||||||
mock_time.set(60)
|
mock_time.set(60)
|
||||||
|
|
||||||
|
context = test_helper.get_context()
|
||||||
druid = druid_system.new(context)
|
druid = druid_system.new(context)
|
||||||
|
|
||||||
parent = mock_gui.add_box("parent", 0, 0, 50, 50)
|
parent = mock_gui.add_box("parent", 0, 0, 50, 50)
|
||||||
|
@ -1,17 +1,26 @@
|
|||||||
return function()
|
return function()
|
||||||
local mock_gui = require "deftest.mock.gui"
|
local mock_gui = nil
|
||||||
local mock_time = require("deftest.mock.time")
|
local mock_time = nil
|
||||||
local mock_input = require("test.helper.mock_input")
|
local mock_input = nil
|
||||||
local test_helper = require("test.helper.test_helper")
|
local test_helper = nil
|
||||||
local druid_system = require("druid.druid")
|
local druid_system = nil
|
||||||
|
|
||||||
local druid = nil
|
local druid = nil
|
||||||
local context = test_helper.get_context()
|
local context = nil
|
||||||
|
|
||||||
describe("Template component", function()
|
describe("Template component", function()
|
||||||
before(function()
|
before(function()
|
||||||
|
mock_gui = require("deftest.mock.gui")
|
||||||
|
mock_time = require("deftest.mock.time")
|
||||||
|
mock_input = require("test.helper.mock_input")
|
||||||
|
test_helper = require("test.helper.test_helper")
|
||||||
|
druid_system = require("druid.druid")
|
||||||
|
|
||||||
mock_gui.mock()
|
mock_gui.mock()
|
||||||
mock_time.mock()
|
mock_time.mock()
|
||||||
mock_time.set(60)
|
mock_time.set(60)
|
||||||
|
|
||||||
|
context = test_helper.get_context()
|
||||||
druid = druid_system.new(context)
|
druid = druid_system.new(context)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user