Added property __dirname to window. Nearly all tests are running now.