updated jsvm types

This commit is contained in:
Gani Georgiev 2024-01-03 11:08:30 +02:00
parent 1fcc2d8683
commit 982f876a93
4 changed files with 4744 additions and 4722 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -7,6 +7,8 @@ import (
) )
func TestCronNew(t *testing.T) { func TestCronNew(t *testing.T) {
t.Parallel()
c := New() c := New()
expectedInterval := 1 * time.Minute expectedInterval := 1 * time.Minute
@ -29,6 +31,8 @@ func TestCronNew(t *testing.T) {
} }
func TestCronSetInterval(t *testing.T) { func TestCronSetInterval(t *testing.T) {
t.Parallel()
c := New() c := New()
interval := 2 * time.Minute interval := 2 * time.Minute
@ -41,6 +45,8 @@ func TestCronSetInterval(t *testing.T) {
} }
func TestCronSetTimezone(t *testing.T) { func TestCronSetTimezone(t *testing.T) {
t.Parallel()
c := New() c := New()
timezone, _ := time.LoadLocation("Asia/Tokyo") timezone, _ := time.LoadLocation("Asia/Tokyo")
@ -53,6 +59,8 @@ func TestCronSetTimezone(t *testing.T) {
} }
func TestCronAddAndRemove(t *testing.T) { func TestCronAddAndRemove(t *testing.T) {
t.Parallel()
c := New() c := New()
if err := c.Add("test0", "* * * * *", nil); err == nil { if err := c.Add("test0", "* * * * *", nil); err == nil {
@ -126,6 +134,8 @@ func TestCronAddAndRemove(t *testing.T) {
} }
func TestCronMustAdd(t *testing.T) { func TestCronMustAdd(t *testing.T) {
t.Parallel()
c := New() c := New()
defer func() { defer func() {
@ -144,6 +154,8 @@ func TestCronMustAdd(t *testing.T) {
} }
func TestCronRemoveAll(t *testing.T) { func TestCronRemoveAll(t *testing.T) {
t.Parallel()
c := New() c := New()
if err := c.Add("test1", "* * * * *", func() {}); err != nil { if err := c.Add("test1", "* * * * *", func() {}); err != nil {
@ -170,6 +182,8 @@ func TestCronRemoveAll(t *testing.T) {
} }
func TestCronTotal(t *testing.T) { func TestCronTotal(t *testing.T) {
t.Parallel()
c := New() c := New()
if v := c.Total(); v != 0 { if v := c.Total(); v != 0 {
@ -195,6 +209,8 @@ func TestCronTotal(t *testing.T) {
} }
func TestCronStartStop(t *testing.T) { func TestCronStartStop(t *testing.T) {
t.Parallel()
c := New() c := New()
c.SetInterval(1 * time.Second) c.SetInterval(1 * time.Second)

View File

@ -9,6 +9,8 @@ import (
) )
func TestNewMoment(t *testing.T) { func TestNewMoment(t *testing.T) {
t.Parallel()
date, err := time.Parse("2006-01-02 15:04", "2023-05-09 15:20") date, err := time.Parse("2006-01-02 15:04", "2023-05-09 15:20")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -38,6 +40,8 @@ func TestNewMoment(t *testing.T) {
} }
func TestNewSchedule(t *testing.T) { func TestNewSchedule(t *testing.T) {
t.Parallel()
scenarios := []struct { scenarios := []struct {
cronExpr string cronExpr string
expectError bool expectError bool
@ -272,6 +276,8 @@ func TestNewSchedule(t *testing.T) {
} }
func TestScheduleIsDue(t *testing.T) { func TestScheduleIsDue(t *testing.T) {
t.Parallel()
scenarios := []struct { scenarios := []struct {
cronExpr string cronExpr string
moment *cron.Moment moment *cron.Moment