Skip to content

Commit 8695959

Browse files
authored
Merge pull request #27 from ora-io/dev
test(orap): fix
2 parents 21453a7 + e7bed58 commit 8695959

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/orap/src/task/verse.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { beforeEach, describe, expect, it, vi } from 'vitest'
2-
import { sleep } from '@ora-io/utils'
2+
import { argParser, sleep } from '@ora-io/utils'
33
import { EventFlow, OrapFlow, TaskFlow } from '../flow'
44
import type { StoreManager } from '../store'
55
import { getMiddlewareContext } from '../utils'
@@ -161,12 +161,13 @@ describe('TaskRaplized', () => {
161161
const eventLog = [1, 2, 3]
162162
taskRaplized.eventLog = eventLog
163163
const result = taskRaplized.toString()
164-
expect(result).toEqual(JSON.stringify(eventLog))
164+
expect(result).toEqual(JSON.stringify(argParser.parse(eventLog)))
165165
})
166166

167167
it('should convert the task from a string', () => {
168168
const jsonString = '[1,2,3]'
169-
const result = taskRaplized.fromString(jsonString)
169+
const parseValue = JSON.stringify(argParser.parse(JSON.parse(jsonString)))
170+
const result = taskRaplized.fromString(parseValue)
170171
expect(result).toEqual(taskRaplized)
171172
expect(taskRaplized.eventLog).toEqual(JSON.parse(jsonString))
172173
})

0 commit comments

Comments
 (0)