mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-06-20 18:02:11 +03:00
Add Surge MITM and scripts
This commit is contained in:
20
script/jsc/time_test.go
Normal file
20
script/jsc/time_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package jsc_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/sing-box/script/jsc"
|
||||
|
||||
"github.com/dop251/goja"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestTimeToValue(t *testing.T) {
|
||||
t.Parallel()
|
||||
runtime := goja.New()
|
||||
now := time.Now()
|
||||
err := runtime.Set("now", jsc.TimeToValue(runtime, now))
|
||||
require.NoError(t, err)
|
||||
println(runtime.Get("now").String())
|
||||
}
|
||||
Reference in New Issue
Block a user