File tree Expand file tree Collapse file tree 7 files changed +93
-414
lines changed
apm_modules/@rakis/test-unit Expand file tree Collapse file tree 7 files changed +93
-414
lines changed Original file line number Diff line number Diff line change 33hyper AOS is a hyperBEAM based implementation of AOS, focused to deliver lighting fast performance to the AO network.
44
55
6+ ## Developer Setup
67
7- coming soon
8+
9+ * Install lua
10+
11+ ``` sh
12+ wget https://www.lua.org/ftp/lua-5.3.6.tar.gz
13+ tar -xzf lua-5.3.6.tar.gz
14+ cd lua-5.3.6
15+ ```
16+
17+ For linux
18+
19+ ``` sh
20+ make linux
21+ ```
22+
23+ For mac
24+
25+ ``` sh
26+ make macosx
27+ ```
28+
29+ ``` sh
30+ sudo make install
31+ ```
32+
33+ * Install luarocks
34+
35+ ``` sh
36+ wget https://luarocks.org/releases/luarocks-3.9.2.tar.gz
37+ tar -xzf luarocks-3.9.2.tar.gz
38+ cd luarocks-3.9.2
39+ ```
40+
41+ ``` sh
42+ ./configure --lua-version=5.3 --with-lua=/usr/local
43+ make
44+ sudo make install
45+ ```
46+
47+ * Init lua env
48+
49+ ``` sh
50+ luarocks init
51+ ```
52+
53+ * Install busted testing library
54+
55+ ``` sh
56+ luarocks install busted
57+ ```
58+
59+ * Setup lua env
60+
61+ ``` sh
62+ eval $( luarocks path)
63+ ```
64+
65+ ## Tests
66+
67+ * Running Tests
68+
69+ ``` sh
70+ busted
71+ ```
72+
73+ * Writing Tests
74+
75+ Add your test in the ` spec ` folder and name the test ending with ` _spec.lua `
76+
77+
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ --[[
2+ hyper AOS unit tests
3+
4+ utils module
5+
6+ * matchesPattern
7+ ]]
8+ local utils = require (' src/utils' )
9+
10+ describe (" utils" , function ()
11+ describe (" matchesSpec" , function ()
12+ it (" should match action" , function ()
13+ assert .is_true (utils .matchesSpec ({ action = " Balance" }, " Balance" ))
14+ end )
15+ it (" should match body.action" , function ()
16+ assert .is_true (utils .matchesSpec ({ body = { action = " Balance" }}, " Balance" ))
17+ end )
18+ it (" should match body.method" , function ()
19+ assert .is_true (utils .matchesSpec ({ body = { method = " beep" }}, { method = " beep" }))
20+ end )
21+ end )
22+ end )
You can’t perform that action at this time.
0 commit comments