meteor-velocity

Meteor / Jasmine / Velocity : how to test a server method requiring logged in user?

妖精的绣舞 提交于 2020-01-31 08:44:46
问题 Using velocity/jasmine, I'm a bit stuck on how I should test a server-side method requiring that there be a currently logged-in user. Is there a way to make Meteor think a user is logged in via stub/fake ? myServerSideModel.doThisServerSideThing = function(){ var user = Meteor.user(); if(!user) throw new Meteor.Error('403', 'not-autorized'); } Jasmine.onTest(function () { describe("doThisServerSideThing", function(){ it('should only work if user is logged in', function(){ // this only works

Test if email is send in Meteor Velocity

試著忘記壹切 提交于 2020-01-25 20:58:45
问题 Is it possible to confirm emails are being sent in Meteor Velocity tests? I thought I could just have a method in tests with the same name that override/duplicates the method, but that doesn't work. I tried this: In my regular code: Meteor.methods( email: (parameters) -> sendAnEmail(parameters) ) In tests : Meteor.methods( email: (parameters) -> differentBehaviorForTesting(parameters) # I could call some super() here if necessary ) But this always gets me a Error: A method named 'email' is

Test if email is send in Meteor Velocity

怎甘沉沦 提交于 2020-01-25 20:58:06
问题 Is it possible to confirm emails are being sent in Meteor Velocity tests? I thought I could just have a method in tests with the same name that override/duplicates the method, but that doesn't work. I tried this: In my regular code: Meteor.methods( email: (parameters) -> sendAnEmail(parameters) ) In tests : Meteor.methods( email: (parameters) -> differentBehaviorForTesting(parameters) # I could call some super() here if necessary ) But this always gets me a Error: A method named 'email' is

WebDriver element is returning false for isVisible/waitForForVisible

拟墨画扇 提交于 2020-01-25 11:52:29
问题 I am working on my first set of Cucumber tests in a Meteor app, but I cannot get the login step to work. My app uses a custom login plugin I wrote specifically for this project. Here is the step, as I currently have it defined with debug output: this.Given(/^I am logged in as a\/an "([^"]*)"$/, function(roleName, callback) { this.browser .url(url.resolve(process.env.HOST, '/')) .waitForExist('#appSignIn'); this.browser.getHTML('#appSignIn', function(err, html) { if (err) { console.log('err: '

How can I get Meteor (client) unit tests (using Velocity with Jasmine) to work in Cordova on device?

旧巷老猫 提交于 2020-01-06 07:39:21
问题 I have a mobile Meteor project (Cordova + Ionic Framework + Angular-Meteor) with unit-tests set up with Velocity and Jasmine. When testing in the browser, the client tests execute as expected but fail on mobile devices. The test servers are hosted at localhost so the devices can't find my computer which hosts the app and test servers. How can I change the Velocity test servers host from localhost to my LAN IP address? 回答1: You need to set your ROOT_URL environment variable. I found that if my

Can I use Velocity with Meteor Up?

折月煮酒 提交于 2019-12-25 00:36:35
问题 I recently started using Velocity with Meteor and really like having the HTML reporter as I go. It would be great if the rest of my team could see the testing status on our dev and testing servers, which are deployed on AWS EC2 via Meteor Up. Unfortunately, Velocity relies on Meteor running in debug mode (what you get with meteor or meteor run locally), and turns off for production deployments (running the Node app that you get from meteor build ). Meteor Up (as well as most PaaS deployment

How do you change the iframe address used by Meteor Velocity

£可爱£侵袭症+ 提交于 2019-12-14 03:59:16
问题 I am using Codio for my Meteor development, so my app is not hosted at localhost:3000 when I'm previewing it, it's actually at random-name.codio.io:3000 , which I have to get to by visiting random-name-3000.codio.io , so when Velocity fires up its iframe to run client-side tests on it has the wrong address, like so: <iframe src="http://localhost:5000/?mocha=true&lastModified=1427105608181"> . How do I convince Velocity to use random-name-5000.codio.io as its src instead of localhost:5000 ?

How to integrate meteor's velocity tests with jenkins?

↘锁芯ラ 提交于 2019-12-12 15:53:16
问题 On Velocity's GH page it mentions "easy CI integration" as one of the benefits, but I haven't seen any documentation about it. How can I integrate Velocity with Jenkins? 回答1: You should use: meteor --test meteor run --test This does the same thing as the velocity-ci without the extra installation 回答2: You could try the velocity-ci velocity-cli NPM module for running your velocity test suites from the command-line Installation npm install -g velocity-ci Run From inside your project directory

Get Mongo Collection in Meteor velocity test

不打扰是莪最后的温柔 提交于 2019-12-12 03:19:52
问题 Currently I'm working on a meteor project, in which I wrote some packages. Now I have a problem when writing test codes for these packages. I used mike:mocha in Velocity. In package I've created a Collection using: TestCollect = new Meteor.Collection("testCollect"); and in my package/server.js if(TestCollect.find().count == 0){ TestCollect.insert({}); } ... /*I want to make sure there is only doc in this collection */ Then I export this variable in package.js api.export("TestCollect"); and in

Xolvio Cucumber - Getting errors in console yet all tests are passing

∥☆過路亽.° 提交于 2019-12-11 03:27:03
问题 I have the following code. It seems like my tests pass, but I get tons of errors in my console. What's going on? Are my tests non-deterministic and being re-run? If so how do I prevent the errors? login.feature: Feature: User authentication As a user I want to be able to login So that I can have all the good stuff that comes with user accounts Background: Given I am signed out Scenario: A user can sign up with valid information Given I am on the home page When I open the sign up modal And I