For my own private pet projects, I never bother setting up a build server. It was too much hassle. Too […]
Tag: #test
How to simulate connection timeouts – on Windows 2016 – Windows firewall?
A server stack is the collection of software that forms the operational infrastructure on a given machine. In a computing […]
SinonJs & QUnit timers
If you use QUnit and SinonJS to test your code be careful with the clock. QUnit’s asyncTest will rely on […]
Testing $.ajax calls with Jasmine 2
A quick and easy way of implementing tests for your applications Ajax calls (assuming jQuery here, but it will work […]
How to correctly test if the url is under HTTPS with PHP
Most likely your application will be under a load balancer when in production. If you need to test if the […]
Randomise variables for testing
Whenever I’m testing I like to use randomised variables that I can later inspect to confirm an operation without risk […]
Free build server as a service for C#/.Net
For my own private pet projects, I never bother setting up a build server. It was too much hassle. Too […]
test php unit private and protected methods
This is a handy solution to test private or protected methods in phpunit. public function invokeMethod(&$object, $methodName, array $parameters = […]
Test your Ruby code with Pry
I’m moving my projects to MicroTest & couldn’t live without the Pry integration these days. http://hopsoft.github.com/micro_test/
Just a Python Faker
Faker is a Python package that generates fake data for you. Whether you need to bootstrap your database, create good-looking […]
Phpunit + Git Pre-commit awesomeness
For a recent project I’ve needed to make sure that all my code is ship-shape for delivery. This has meant […]
Ruby on Rails: test logs output presence within Rails.logger (through Minitest too)
require ‘test_helper’ class MyTest < ActionDispatch::IntegrationTest def with_logger_introspection(&block) orig_logger = Rails.logger.dup @logger_output = StringIO.new begin Rails.logger = ActiveSupport::Logger.new(@logger_output) block.call(@logger_output) ensure […]
Creating base64 test files
I was in the process of writing and testing a FileObject class in PHP for abstracting file handling, and I […]
Display Test::Unit test names when running tests
Just provide the –verbose option when executing the tests. E.g rake test TEST_OPTS=”–verbose” ruby -Ilib:test test/your_test.rb –verbose
Run a single Python unittest
If you maintain your unittest tests as a package, you can run a single one like this python -m unittest […]
minitest vs rspec
a presentation slide at rubyhiroba2013 https://speakerdeck.com/willnet/minitest-vs-rspec
Running Mocha tests without a browser (not even PhantomJS)
Integrations tests should be written to run in a real browser, but javascript unit tests should be simply testing units […]
Test for real-world network speeds
When you develop websites or apps your server is usually inside a local network or even in your own computer. […]
Building and using multiple PHP versions
I recently open sourced a tool that I use to manage multiple PHP versions on a single system. It currently […]
Mask heterogenous test suites with cake
Sometimes you can’t fit all of your test suites into one runner. Client-side code should run in a real client, […]
- 1
- 2