提交 63e433a2 编写于 作者: W wangjinxin613

test: 调整测试例兼容 android

上级 83407edf
...@@ -133,7 +133,7 @@ describe('watchEffect', () => { ...@@ -133,7 +133,7 @@ describe('watchEffect', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android')) {
expect(await watchObjRes.text()).toBe( expect(await watchObjRes.text()).toBe(
'watch obj result: obj: {"arr":[0],"bool":false,"num":0,"str":"num: 0"}') 'watch obj result: obj: {"arr":[0,1],"bool":true,"num":1,"str":"num: 1"}')
} }
if (process.env.uniTestPlatformInfo.startsWith('web')) { if (process.env.uniTestPlatformInfo.startsWith('web')) {
expect(await watchObjRes.text()).toBe( expect(await watchObjRes.text()).toBe(
......
...@@ -107,8 +107,7 @@ describe('watchPostEffect', () => { ...@@ -107,8 +107,7 @@ describe('watchPostEffect', () => {
const watchObjRes = await page.$('#watch-obj-res') const watchObjRes = await page.$('#watch-obj-res')
// TODO web端和安卓端JSON.stringify对属性的排序不一致 // TODO web端和安卓端JSON.stringify对属性的排序不一致
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith( if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
'IOS')) {
expect(await watchObjRes.text()).toBe( expect(await watchObjRes.text()).toBe(
'watch obj result: obj: {"num":0,"str":"num: 0","bool":false,"arr":[0]}' 'watch obj result: obj: {"num":0,"str":"num: 0","bool":false,"arr":[0]}'
) )
...@@ -136,14 +135,13 @@ describe('watchPostEffect', () => { ...@@ -136,14 +135,13 @@ describe('watchPostEffect', () => {
expect(await objBool.text()).toBe('obj.bool: true') expect(await objBool.text()).toBe('obj.bool: true')
expect(await objArr.text()).toBe('obj.arr: [0,1]') expect(await objArr.text()).toBe('obj.arr: [0,1]')
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith( if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
'IOS')) {
expect(await watchObjRes.text()).toBe( expect(await watchObjRes.text()).toBe(
'watch obj result: obj: {"num":1,"str":"num: 1","bool":true,"arr":[0,1]}' 'watch obj result: obj: {"num":1,"str":"num: 1","bool":true,"arr":[0,1]}'
) )
} else { } else {
expect(await watchObjRes.text()).toBe( expect(await watchObjRes.text()).toBe(
'watch obj result: obj: {"arr":[0],"bool":false,"num":0,"str":"num: 0"}' 'watch obj result: obj: {"arr":[0,1],"bool":true,"num":1,"str":"num: 1"}'
) )
} }
expect(await watchObjStrRes.text()).toBe( expect(await watchObjStrRes.text()).toBe(
......
...@@ -106,8 +106,7 @@ describe('watchSyncEffect', () => { ...@@ -106,8 +106,7 @@ describe('watchSyncEffect', () => {
expect(await objArr.text()).toBe('obj.arr: [0]') expect(await objArr.text()).toBe('obj.arr: [0]')
const watchObjRes = await page.$('#watch-obj-res') const watchObjRes = await page.$('#watch-obj-res')
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith( if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
'IOS')) {
expect(await watchObjRes.text()).toBe( expect(await watchObjRes.text()).toBe(
'watch obj result: obj: {"num":0,"str":"num: 0","bool":false,"arr":[0]}' 'watch obj result: obj: {"num":0,"str":"num: 0","bool":false,"arr":[0]}'
) )
...@@ -136,14 +135,13 @@ describe('watchSyncEffect', () => { ...@@ -136,14 +135,13 @@ describe('watchSyncEffect', () => {
expect(await objBool.text()).toBe('obj.bool: true') expect(await objBool.text()).toBe('obj.bool: true')
expect(await objArr.text()).toBe('obj.arr: [0,1]') expect(await objArr.text()).toBe('obj.arr: [0,1]')
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.startsWith( if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLocaleLowerCase().startsWith('ios')) {
'IOS')) {
expect(await watchObjRes.text()).toBe( expect(await watchObjRes.text()).toBe(
'watch obj result: obj: {"num":1,"str":"num: 1","bool":true,"arr":[0,1]}' 'watch obj result: obj: {"num":1,"str":"num: 1","bool":true,"arr":[0,1]}'
) )
} else { } else {
expect(await watchObjRes.text()).toBe( expect(await watchObjRes.text()).toBe(
'watch obj result: obj: {"arr":[0],"bool":false,"num":0,"str":"num: 0"}' 'watch obj result: obj: {"arr":[0,1],"bool":true,"num":1,"str":"num: 1"}'
) )
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册