compress-image.test.js 730 B

12345678910111213141516171819202122232425
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isIOS = platformInfo.startsWith('ios')
  3. const isWeb = platformInfo.startsWith('web')
  4. const isMP = platformInfo.startsWith('mp')
  5. describe('API-compressImage', () => {
  6. if (isWeb || isIOS || isMP) {
  7. it('pass', async () => {
  8. expect(1).toBe(1);
  9. });
  10. return;
  11. }
  12. it('test compressImage', async () => {
  13. const page = await program.reLaunch('/pages/API/compress-image/compress-image');
  14. await page.waitFor('view');
  15. await page.callMethod('testCompressImage');
  16. await page.waitFor(1000);
  17. expect(await page.data('imageInfoForTest')).toEqual({
  18. width: 100,
  19. height: 100,
  20. isSizeReduce: true
  21. });
  22. });
  23. });