Skip to content

Commit 8bb2854

Browse files
author
RoFlection Bot
committed
Initial commit
0 parents  commit 8bb2854

File tree

14 files changed

+269
-0
lines changed

14 files changed

+269
-0
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Packages/*
2+
!Packages/.robloxrc
3+
4+
rotriever.lock
5+
roblox.toml
6+
*.rbxmx
7+
*.rbxm
8+
9+
.vscode/launch.json
10+
.vscode/settings.json
11+
.vscode/tasks.json
12+
.idea

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Roblox
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Packages/.robloxrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"language": {
3+
"mode": "nocheck"
4+
},
5+
"lint": {
6+
"*": "disabled"
7+
}
8+
}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# react-testing-library-lua
2+
3+
* Port version [v12.1.5](https://github.com/testing-library/react-testing-library/tree/v12.1.5)

analyze.project.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "ReactTestingLibrary",
3+
"tree": {
4+
"$className": "Folder",
5+
"Packages": {
6+
"$path": "Packages",
7+
"ReactTestingLibrary": {
8+
"$path": "src"
9+
},
10+
"Types": {
11+
"$path": "types"
12+
}
13+
}
14+
}
15+
}

bin/ci.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
echo "Remove .robloxrc from dev dependencies"
6+
find Packages/Dev -name "*.robloxrc" | xargs rm -f
7+
find Packages/_Index -name "*.robloxrc" | xargs rm -f
8+
9+
echo "Run static analysis"
10+
selene src types
11+
roblox-cli analyze analyze.project.json
12+
stylua -c src types
13+
14+
echo "Run tests"
15+
roblox-cli run --load.place tests.project.json --run bin/spec.lua --lua.globals=__DEV__=true --fastFlags.allOnLuau --fastFlags.overrides EnableLoadModule=true --fs.read=$PWD --load.asRobloxScript --headlessRenderer 1 --virtualInput 1

bin/spec.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
local Root = game:GetService("ReplicatedStorage")
2+
3+
local Packages = Root.Packages
4+
5+
local JestGlobals = require(Packages.Dev.JestGlobals)
6+
7+
local TestEZ = JestGlobals.TestEZ
8+
9+
-- Run all tests, collect results, and report to stdout.
10+
TestEZ.TestBootstrap:run(
11+
{ Packages.ReactTestingLibrary },
12+
TestEZ.Reporters.pipe({
13+
TestEZ.Reporters.JestDefaultReporter,
14+
TestEZ.Reporters.JestSummaryReporter,
15+
}),
16+
{
17+
extraEnvironment = JestGlobals.testEnv,
18+
}
19+
)
20+
-- ROBLOX TODO: after converting jest-runner this should be included there
21+
JestGlobals.runtime:teardown()
22+
23+
return nil

default.project.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "ReactTestingLibrary",
3+
"tree": {
4+
"$className": "Folder",
5+
"Packages": {
6+
"$path": "Packages",
7+
"ReactTestingLibrary": {
8+
"$path": "src"
9+
},
10+
"Types": {
11+
"$path": "types"
12+
}
13+
}
14+
}
15+
}

foreman.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[tools]
2+
rotrieve = { source = "roblox/rotriever", version = "0.5.4" }
3+
selene = { source = "Kampfkarren/selene", version = "0.18.2" }
4+
stylua = { source = "JohnnyMorganz/StyLua", version = "=0.13.1" }

rotriever.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "ReactTestingLibrary"
3+
version = "0.0.1"
4+
authors = [
5+
6+
]
7+
content_root = "src"
8+
9+
[dependencies]
10+
LuauPolyfill = "github.com/roblox/[email protected]"
11+
Promise = "github.com/evaera/[email protected]"
12+
DomTestingLibrary = { git = "https://github.com/roblox/dom-testing-library-lua.git", rev="main" }
13+
14+
[dev_dependencies]
15+
JestGlobals = { git = "https://github.com/roblox/jest-roblox.git", rev="master" }

0 commit comments

Comments
 (0)