To reproduce, create a simple package: main.go: package main func main() {} main_test.go: package main import "testing" func TestFoo(t *testing.T) {} main_test.inc.js: /* main_test.inc.js */ then compile: $ gopherjs build -o main.js And observe that the output contains the contents of the `inc.js` file: $ grep -n main_test main.js 2331: /* main_test.inc.js */