I will begin by saying ” DON’T EVER DO THIS IN THE REAL WORLD”. https://github.com/auchenberg/volkswagen will detect if your build is running inside a CI tool and then force all tests to pass; even if they fail. Now you know why I said “DON’T EVER DO THIS IN THE REAL WORLD”. Hey just having some fun … code quality purists you have been warned not to read further! 🙂
Some simple code is at https://github.com/thomasma/funwithfailingtests . I used CircleCI to quickly setup a basic build together. All it does is build and test the simple nodejs code. The code in addIt.js has a purposely introduced bug, where adding two numbers always returns the wrong result. The unit test in the test/ folder (test.js & test2.js) are setup correctly but will fail since result does not match expected value.
Normally this will be caught by the CI tool and can be used to fail the build. But this cheeky thing called voltswagen once added to any test will pass all builds if it detects a supported CI tool.
Just include this in one of your test files
1 |
require('volkswagen') |
The tool will detect the CI tool (in my case CirclieCI) and forcibly pass all unit tests. So my final build is good 🙂
Cheeky ah! Hey this is just for fun. DON’T EVER DO THIS IN REAL WORLD.