Update mock tests

This commit is contained in:
Aaron Smith 2023-08-09 17:58:17 +01:00
parent 04e28f390d
commit b3c600acc3
13 changed files with 94 additions and 246 deletions

View file

@ -1,12 +1,13 @@
local typeof = typeof
if not game then
script = (require :: any) "test/wrap-require"
typeof = require "test/mock".typeof
script = require "test/wrap-require"
typeof = require "test/mock".typeof :: any
end
local graph = require(script.Parent.graph)
type Node<T> = graph.Node<T>
local throw = require(script.Parent.throw)
local bind = require(script.Parent.bind)
local _, is_action = require(script.Parent.action)()

View file

@ -1,13 +1,12 @@
local warn = warn -- todo
local warn = warn
if not game then
script = (require :: any) "test/wrap-require"
script = require "test/wrap-require"
warn = print
end
local graph = require(script.Parent.graph)
type Node<T> = graph.Node<T>
local get = graph.get
local set_effect = graph.set_effect
local capture = graph.capture

View file

@ -1,5 +1,8 @@
local Instance = Instance
local typeof = typeof
if not game then
script = (require :: any) "test/wrap-require"
script = require "test/wrap-require"
Instance = require("test/mock").Instance
typeof = require("test/mock").typeof
end

View file

@ -1,14 +1,12 @@
-- todo
local Enum = Enum
local Color3 = Color3
local Vector3 = Vector3
if not game then
local mock = require "test/mock"
Enum = mock.Enum :: any
Color3 = mock.Color3 :: any
Vector3 = mock.Vector3 :: any
Enum = mock.Enum
Color3 = mock.Color3
Vector3 = mock.Vector3
end
return {

View file

@ -1,8 +1,7 @@
if not game then script = (require :: any) "test/wrap-require" end
if not game then script = require "test/wrap-require" end
local graph = require(script.Parent.graph)
local create = graph.create
local get = graph.get
local capture_and_link = graph.capture_and_link
local function derive<T>(fn: () -> T): () -> T

View file

@ -1,4 +1,4 @@
if not game then script = (require :: any) "test/wrap-require" end
if not game then script = require "test/wrap-require" end
local flags = require(script.Parent.flags)

View file

@ -3,7 +3,7 @@
-- v0.1.0
--------------------------------------------------------------------------------
if not game then script = (require :: any) "test/wrap-require" end
if not game then script = require "test/wrap-require" end
local create = require(script.create)
local source = require(script.source)

View file

@ -1,4 +1,4 @@
if not game then script = (require :: any) "test/wrap-require" end
if not game then script = require "test/wrap-require" end
local graph = require(script.Parent.graph)
type Node<T> = graph.Node<T>

View file

@ -1,4 +1,4 @@
if not game then script = (require :: any) "test/wrap-require" end
if not game then script = require "test/wrap-require" end
--[[

View file

@ -1,4 +1,4 @@
if not game then script = (require :: any) "test/wrap-require" end
if not game then script = require "test/wrap-require" end
local graph = require(script.Parent.graph)
local set_effect = graph.set_effect