 		return r
 
 	if pathUtils.isAbsolute(req) and req isnt index
+		filename = req
 		modulePath = req
 		parentPath = ''
 	else

		modulePath = pathUtils.relative base, filename
		parentPath = pathUtils.relative base, parent.id

	unless modulesByPaths[modulePath]
		modules.push modulePath
		modulesByPaths[modulePath] = true

	if parentPath
		mpaths = paths[parentPath] ?= {}
		mpaths[req] = modulePath

	r


		val

index = pathUtils.resolve fs.realpathSync('.'), opts.path
{platform, test, testResolved, path} = opts
test ?= -> true
testResolved ?= -> true

customGlobalProps = Object.create null
mockGlobal = (obj) ->
