老哥,我们这边没用过云开发,不太了解,建议微信群里找官方大大看下吧
在云开发的时候建立了两个环境,切换的时候数据库并没有切换过来,依然调用的是另外一个云环境下的数据库?[图片]
2022-11-01[图片]刚刚试了一下真机也会有同样的报错
自动化测试 mockWxMethod(request) 报错 _from、_promise 未定义const path = require('path'); const automator = require('miniprogram-automator'); let e2eRc = require(path.resolve(process.cwd(), '.e2erc.js')); let timer = null; jest.setTimeout(30000000); describe('minitest-2', () => { let miniProgram; beforeAll(async () => { miniProgram = await automator.launch({ projectPath: e2eRc.projectPath, }); }, 30000000); afterAll(async () => { clearInterval(timer); await miniProgram.disconnect(); }); it('minitest-2', async () => { // request 不能 mock 了 await miniProgram.mockWxMethod( 'request', function(obj, platform) { console.log('typeof Promise ----->', typeof Promise); // 模拟器无输出 return new Promise((resolve, reject) => { this.origin({...obj, success (res) { resolve(res)} }); }) } ); let page; page = await miniProgram.currentPage(); await page.waitFor(10000); }); }); [图片]
2022-09-20