fix: 修复score有时计算不准确的问题
This commit is contained in:
11
test/utils/tools.test.js
Normal file
11
test/utils/tools.test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { computeScore } from '@/utils/tools'
|
||||
import { zeroData, undefinedData } from './mockData/score'
|
||||
|
||||
describe('computeScore测试', () => {
|
||||
test('含0', () => {
|
||||
expect(computeScore(zeroData)).toEqual(6)
|
||||
})
|
||||
test('含undefined', () => {
|
||||
expect(computeScore(undefinedData)).toEqual('-')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user