Hack: Quickly Verify That All Your Mocha/Chai Tests Have Valid Assertions

Chai is a popular Node/browser assertion library. However – as everything – it has its flaws. An important flaw is that it performs checks on property access – and if you e.g. misspell the name of an assertion, it will be just ignored (for there is no way for Chai to know that you tried to accessContinue reading “Hack: Quickly Verify That All Your Mocha/Chai Tests Have Valid Assertions”

Git pre-commit hook that fails if “it.only” used (Jest/Jasmine)

One of the annoying things with Jest is that while it enables you to run only a single test by using it.only, it does not report this in any noticeable way. Thus you can end up in the same situation as we did, not running many tests without knowing it. (Oh yeah, if we onlyContinue reading “Git pre-commit hook that fails if “it.only” used (Jest/Jasmine)”

Challenging Myself With Coplien’s Why Most Unit Testing is Waste

James O. Coplien has written in 2014 the thought-provoking essay Why Most Unit Testing is Waste and further elaborates the topic in his Segue. I love testing but I also value challenging my views to expand my understanding so it was a valuable read. When encountering something so controversial, it’s crucial to set aside one’s emotionsContinue reading “Challenging Myself With Coplien’s Why Most Unit Testing is Waste”

Running JavaScript Tests On a CI Server With Karma, Chrome And Fake X

So I want to run my JavaScript tests in a browser on our CI server. But the server has no graphical environment and the tests do not run under PhantomJS 1.x because it uses too old WebKit without ES5. The solution? Use a real browser and fake X via Xvfb. The browser I use isContinue reading “Running JavaScript Tests On a CI Server With Karma, Chrome And Fake X”

Continuous Delivery Digest: Ch.9 Testing Non-Functional Requirements

(Cross-posted from blog.iterate.no) Digest of chapter 9 of the Continuous Delivery bible by Humble and Farley. See also the digest of ch 8: Automated Acceptance Testing. (“cross-functional” might be better as they too are crucial for functionality) f.ex. security, usability, maintainability, auditability, configurability but especially capacity, throughput, performance performance = time to process 1 transactionContinue reading “Continuous Delivery Digest: Ch.9 Testing Non-Functional Requirements”

Notes On Automated Acceptance Testing (from the Continuous Delivery book)

(Cross-posted from blog.iterate.no) These are my rather extensive notes from reading the chapter 8 on Automated Acceptance Testing in the Continuous Delivery bible by Humble and Farley. There is plenty of very good advice that I just had to take record of. Acceptance testing is an exciting and important subject. Why should you care aboutContinue reading “Notes On Automated Acceptance Testing (from the Continuous Delivery book)”

Notes From CodeMesh 2014

My consise highlights from CodeMesh 2014. Philip Potter has very good CodeMesh notes as well, as usually. TODO: Check out the papers mentioned in the  NoSQL is Dead talk. (<- slides) Tutorial: QuickCheck (John Hughes) General QC => Less code, more bugs found QC tests are based on models of the system under test –Continue reading “Notes From CodeMesh 2014”

Fixing clojurescript.test failing with “ReferenceError: Can’t find variable: cemerick”

ClojureScript.test (0.3.0; cemerick.cljs.test) may fail with this confusing exception: due to couple of reasons: Your test namespaces do not require cemerick.cljs.test (and thus it is missing from the compiled .js; requiring macros is not enough) cljsbuild has not included any of your test files (due to wrong setup etc.; this is essentially another form ofContinue reading “Fixing clojurescript.test failing with “ReferenceError: Can’t find variable: cemerick””

How to create and run Gatling 2.0 tests

Getting up and running with Gatling perf. tests as I would like so I record this for my future reference. 0. Create a project: (The trailing “:” in the filter is important.) 1. Import to IntelliJ In IntelliJ choose to import an object, instead of “from sources” select “from external model” and then Maven. YouContinue reading “How to create and run Gatling 2.0 tests”

How To Generate A Valid Credit Card Number For A Bin (First 6 Digits)

There is plenty of generators that can produce numbers that are valid credit card numbers according to the Luhn check and specific rules of the individual issuer companies. However I have not found anything that would generate the missing digits given a bin, i.e. the first 6 digits of a credit card (the “bank identificationContinue reading “How To Generate A Valid Credit Card Number For A Bin (First 6 Digits)”