【问题标题】:Client integration test with velocity and jasmine on Meteor在 Meteor 上使用速度和茉莉花进行客户端集成测试
【发布时间】:2014-12-17 17:21:49
【问题描述】:

我做了这个测试:

describe('SignIn', function () {
it('should be able to login normal user', function (done) {
    Meteor.loginWithPassword('example@gmail.com', '000000', function (err) {
        expect(err).toBeUndefined();
        done();
    });
  });
});

我收到以下错误:

Expected { error : 403, reason : 'User not found', details : undefined, message : 'User not found [403]', errorType : 'Meteor.Error' } to be undefined. While the user exists (can log in with the form)

但我可以使用流星应用程序的形式登录为“example@gmail.com”,以便用户存在。我的代码有问题吗?

【问题讨论】:

    标签: meteor jasmine meteor-velocity


    【解决方案1】:

    您的代码没有任何问题,这是因为测试是针对镜像运行的,镜像是一个并行应用程序。这种方法允许测试在不影响主应用的情况下破坏数据。

    你应该做的是在一个前块中创建一个用户,然后你可以用那个用户登录。

    【讨论】:

    • 这显然是有道理的!谢谢,您刚刚解决了我的问题并解释了原因。再次感谢您!
    猜你喜欢
    • 1970-01-01
    • 2017-05-02
    • 1970-01-01
    • 2020-08-19
    • 2014-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多