You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-11-24 07:04:51 +02:00
added JSVM new Timezone binding
This commit is contained in:
@@ -44,7 +44,7 @@ func TestBaseBindsCount(t *testing.T) {
|
||||
vm := goja.New()
|
||||
baseBinds(vm)
|
||||
|
||||
testBindsCount(vm, "this", 32, t)
|
||||
testBindsCount(vm, "this", 33, t)
|
||||
}
|
||||
|
||||
func TestBaseBindsSleep(t *testing.T) {
|
||||
@@ -538,6 +538,31 @@ func TestBaseBindsMiddleware(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBaseBindsTimezone(t *testing.T) {
|
||||
vm := goja.New()
|
||||
baseBinds(vm)
|
||||
|
||||
_, err := vm.RunString(`
|
||||
const v0 = (new Timezone()).string();
|
||||
if (v0 != "UTC") {
|
||||
throw new Error("(v0) Expected UTC got " + v0)
|
||||
}
|
||||
|
||||
const v1 = (new Timezone("invalid")).string();
|
||||
if (v1 != "UTC") {
|
||||
throw new Error("(v1) Expected UTC got " + v1)
|
||||
}
|
||||
|
||||
const v2 = (new Timezone("EET")).string();
|
||||
if (v2 != "EET") {
|
||||
throw new Error("(v2) Expected EET got " + v2)
|
||||
}
|
||||
`)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBaseBindsDateTime(t *testing.T) {
|
||||
vm := goja.New()
|
||||
baseBinds(vm)
|
||||
|
||||
Reference in New Issue
Block a user