testing

Running Mocha tests compiled with Babel in Visual Studio Code

佐手、 提交于 2020-01-01 02:41:11
问题 I am using Babel in my Mocha tests. To run the test in terminal I use following command: mocha --debug --compilers js:babel/register Then I can use VS Code "Attach" debugging option to attach to the test process. I can set breakpoints and it stops, but because original code is in ES6 VS Code gets confused about line numbers and such. Is there anyway to make VS Code work with this setup? My "Attach" config: { "name": "Attach", "type": "node", // TCP/IP address. Default is "localhost". "address

Integration testing: Mock external API vs. use external API sandbox

依然范特西╮ 提交于 2020-01-01 02:36:10
问题 We're required to use the API of an external partner. The API is in a good shape and we got access to a sandbox environment we can use for automatic testing. We already test every single call of the external API using unit tests but are unsure regarding best practices for integration tests when it comes to complex operations on the side of the external partner. Example: Every user of our service also got a user object at our external partner. When performing external API call X on this user

FPS testing in android application

时光怂恿深爱的人放手 提交于 2020-01-01 02:35:11
问题 How can an android application developer test FPS (Frames per second) for their application? I'm talking about general application, not game. It can be on emulator or phone. I've been looking for this but have not found a way. It would be great, if any developer can shed light on this. 回答1: As mention by Guykun and kcoppock, if you are only using the View widgets or Canvas you normally don't look for FPS to determine visual performance. As you don't mention what you are doing other than 'not

How can I test AWS Lambda functions locally?

我与影子孤独终老i 提交于 2020-01-01 02:11:26
问题 Explain to me please what is the best way to locally test the lambda function. I used sam local and this solution https://github.com/lambci/docker-lambda for testing, but for example, where I invoke one lambda from another error occurs. In general, I can't make stubs for methods since lambda runs in a container 回答1: There are a couple of options. Following two are some popular ones. Serverless framework along with the serverless-offline plugin. LocalStack 回答2: This is how I test local lambda

Run PHPUnit tests on change

陌路散爱 提交于 2020-01-01 01:53:09
问题 I'd like to run my PHPUnit tests (or at least a subset of them) whenever a file changes on disk. Very similar to what you can do with "grunt watch". I have a project in which I have both JS and PHP, and am using Grunt. There I shell out to PHPUnit to have it run on top of my JS tests using grunt watch. While that works just fine, it seems like an awful lot of hassle to do this in a PHP only project. I'd need to introduce grunt, and add a dependency on node. Plus I have a lot of such PHP

Protractor instance vs browser

假如想象 提交于 2020-01-01 01:12:06
问题 I have tried to looked up for similar QA's but i couldn't find one to satisfy me. So basically i saw that in some examples it's used ptor = protractor.getInstance(); ptor.get(url); And in some other examples it's used. browser.get(url); So th question is: What's the difference using protractor instance and browser for getting specific url? Also if my assumption in the P.S. is right, which is better practice: to use only protractor, or to mix them? P.S. Also i saw same difference in usage with

How can I create parameterized tests in Rust?

允我心安 提交于 2020-01-01 01:11:35
问题 I want to write test cases that depend on parameters. My test case should be executed for each parameter and I want to see whether it succeeds or fails for each parameter. I'm used to writing things like that in Java: @RunWith(Parameterized.class) public class FibonacciTest { @Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][] { { 0, 0 }, { 1, 1 }, { 2, 1 }, { 3, 2 }, { 4, 3 }, { 5, 5 }, { 6, 8 } }); } private int fInput; private int fExpected; public

Getting the full RSpec test name from within a before(:each) block

白昼怎懂夜的黑 提交于 2020-01-01 01:11:34
问题 RSpec allows you to get the current running test method name in a before(:each) block, by doing the following: Spec::Runner.configure do |config| config.before :each do |x| x.method_name # returns 'should be cool' end end This is for a test like: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe 'Hello world' do it 'should be cool' do # test code end end Would it be possible to get the whole test name with what it's describing, (a.k.a. 'Hello World should be cool')

Best way to test high-volume SMTP email sending code?

巧了我就是萌 提交于 2019-12-31 22:42:30
问题 I've written a component in a Windows service (C#) which is responsible for sending sometimes large volumes of emails. These emails will go to recipients on many domains – really, any domain. (Yes, the recipients want the email. No, I'm not spamming. Yes, I'm in complaince with CAN-SPAM. Yes, I'm aware sending email from code sucks.) Many of the emails are transactional (generated in response to user actions); some are bulk (mail-merges basically). I do not want to rely on an external SMTP

Is unit testing a bad idea during beta/prototyping?

删除回忆录丶 提交于 2019-12-31 18:51:11
问题 A new project we began introduced a lot of new technologies we weren't so familiar with, and an architecture that we don't have a lot of practice in. In other words, the interfaces and interactions between service classes etc of what we're building are fairly volatile, even more so due to internal and customer feedback. Though I've always been frustrated by the ever-moving specification, I see this to some degree a necessary part of building something we've never built before - if we just