Run unit tests in IntelliJ IDEA from multiple modules together

Best way way: (edit after 3 years) There is even a better way to achieve this. From the JetBrains JUnit Run Configuration docs: Select menu “Run” → “Edit Configurations…”. Click green plus in left top corner and select JUnit. Select “Test kind” to “Pattern” and enter this regexp exactly as you see it: ^(?!.*IT$).*$ (it … Read more

How to test the equivalence of maps in Golang?

The Go library has already got you covered. Do this: import “reflect” // m1 and m2 are the maps we want to compare eq := reflect.DeepEqual(m1, m2) if eq { fmt.Println(“They’re equal.”) } else { fmt.Println(“They’re unequal.”) } If you look at the source code for reflect.DeepEqual‘s Map case, you’ll see that it first checks … Read more

Golang testing: “no test files”

Files containing tests should be called name_test, with the _test suffix. They should be alongside the code that they are testing. To run the tests recursively call go test -v ./… From How to Write Go Code: You write a test by creating a file with a name ending in _test.go that contains functions named … Read more

Can I run multiple versions of Google Chrome on the same machine? (Mac or Windows)

In the comments, I mentioned a step-by-step method to easily install multiple Chrome versions, side-by-side. This answer quotes my original answer, and includes a script which does the job for you. Quoted from: section 7 of Cross-browser testing: All major browsers on ONE machine: Chrome: Stand-alone installers can be downloaded from File Hippo. It is … Read more

angular2 testing: Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’

You need to import the FormsModule into the TestBed configfuration. import { FormsModule } from ‘@angular/forms’; TestBed.configureTestingModule({ imports: [ FormsModule ], declarations: [ AppComponent ], providers:[AppService] }); What you are doing with the TestBed is configuring a NgModule from scratch for the test environment. This allows you to only add what is needed for the … Read more

What is the best testing framework to use with Node.js? [closed]

Update: Mocha is the best in my opinion. What is the experience with these frameworks? I played with expresso which is pretty cool testing framework which also has test-coverage. It has been created by TJ Holowaychuk who is also the creator of Express.js (insanely fast (and small) server-side JavaScript web development framework built on Node.js … Read more

How to turn off all SSL checks on Postman for a specific site?

There is an option in Postman if you download it from https://www.getpostman.com instead of the chrome store (most probably it has been introduced in the new versions and the chrome one will be updated later) not sure about the old ones. In the settings, turn off the SSL certificate verification option Be sure to remember … Read more

When should you use render and shallow in Enzyme / React tests?

As per the Enzyme docs: mount(<Component />) for Full DOM rendering is ideal for use cases where you have components that may interact with DOM apis, or may require the full lifecycle in order to fully test the component (ie, componentDidMount etc.) vs. shallow(<Component />) for Shallow rendering is useful to constrain yourself to testing … Read more

How to test panics?

testing doesn’t really have the concept of “success,” only failure. So your code above is about right. You might find this style slightly more clear, but it’s basically the same thing. func TestPanic(t *testing.T) { defer func() { if r := recover(); r == nil { t.Errorf(“The code did not panic”) } }() // The … Read more