drewdeponte / snapdragon

A Jasmine JavaScript test runner that lets you run tests on the command-line similar to RSpec.
Other
6 stars 8 forks source link

Some require files show up twice in the runner when they should only show up once #17

Closed drewdeponte closed 11 years ago

drewdeponte commented 11 years ago

I looked into it a bit and it seems this is happening because the Set which makes sure unique path strings only exist once in the set, users can specify the same path in multiple ways. For example the following map to the same path in the end but their path strings are different:

// require_relative('src/hoopty.js')
// require_relative('./src/hoopty.js')

Because the path strings differ the Set doesn't identify them as being the same. I think the ideal solution would be if we could collapse the paths down to the most basic form that represents the path before it gets added to the Set. That way even if they start out different as long as they represent the same actual path they only get included once.

drewdeponte commented 11 years ago

I resolved this by making sure the absolute expanded path of each path string was unique.