Skip to content

Commit

Permalink
feat(test): test
Browse files Browse the repository at this point in the history
  • Loading branch information
EdamAme-x committed Jan 20, 2024
1 parent a8f72fa commit 61be750
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/status/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// PayPay Status Test
import { PayPayStatus } from './index'

describe('Status', () => {
test('not include space', () => {
for (const Status of Object.values(PayPayStatus)) {
expect(Status).not.toMatch(/\s/)
}
})
})
28 changes: 27 additions & 1 deletion src/utils/is.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PayPay Error Test
// PayPay is Test
import * as util from './is'

describe('Util', () => {
Expand Down Expand Up @@ -28,4 +28,30 @@ describe('Util', () => {
expect(util.isUuid(invalidUuid)).toBeFalsy()
expect(util.isUuid(invalidUuid2)).toBeFalsy()
})

test('isSuccess', () => {
const validSuccess = {
header: {
resultCode: 'S0000',
resultMessage: 'Success',
},
payload: {
paypay: 'resultCode',
oosugi: 'dounikashite'
}
}
const invalidSuccess = {
header: {
resultCode: 'S0001',
resultMessage: 'Invalid anyone',
},
payload: {
paypay: 'resultCode',
oosugi: 'dounikashite'
}
}

expect(util.isSuccess(validSuccess)).toBeTruthy()
expect(util.isSuccess(invalidSuccess)).toBeFalsy()
})
})
2 changes: 1 addition & 1 deletion src/utils/parse.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// PayPay Error Test
// PayPay Parse Test
import * as util from './parse'

describe('Util', () => {
Expand Down

0 comments on commit 61be750

Please sign in to comment.