This repository was archived by the owner on May 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Tests fail on Windows (Cannot read property 'baseDirectory' of undefined) #10
Copy link
Copy link
Open
Description
Example of stacktrace:
~\locator>npm test
> locator@0.3.3 pretest ~\locator
> jshint --config ./node_modules/yui-lint/jshint.json ./lib/ tests/lib/
> locator@0.3.3 test ~\locator
> mocha tests/lib/parseBundle.js --reporter spec
BundleLocator.parseBundle()
1) parseBundle()
0 passing (253 ms)
1 failing
1) BundleLocator.parseBundle() parseBundle():
TypeError: Cannot read property 'baseDirectory' of undefined
at n.<anonymous> (~\locator\lib\bundleLocator.js:497:23)
at new n (~\locator\node_modules\yui\promise\promise-min.js:1:2
28)
at Object.BundleLocator._processFileQueue (~\locator\lib\bundle
Locator.js:486:16)
at n.<anonymous> (~\locator\lib\bundleLocator.js:564:29)
at ~\locator\node_modules\yui\promise\promise-min.js:1:1450
at Object._onImmediate (~\locator\node_modules\yui\timers\timer
s-min.js:1:207)
at processImmediate [as _immediateCallback] (timers.js:330:15)
npm ERR! weird error 1
npm ERR! not ok code 0Issue in the code
Looking at the code, the build fails in bundleLocator.js on line 346 - 348. If I am reading the code correctly, the assumption is that paths will follow the Unix layout, hence the '/' check.
Inserting another condition, '\\' === findPath.charAt(bundlePath.length), will fix the Cannot read property 'baseDirectory' of undefined error, but the tests will not fully pass where actual is 26 and expected is 31.
~\locator>npm test
> locator@0.3.3 pretest ~\locator
> jshint --config ./node_modules/yui-lint/jshint.json ./lib/ tests/lib/
> locator@0.3.3 test ~\locator
> mocha tests/lib/parseBundle.js --reporter spec
BundleLocator.parseBundle()
1) parseBundle()
0 passing (295 ms)
1 failing
1) BundleLocator.parseBundle() parseBundle():
actual expected
31 26
npm ERR! weird error 1
npm ERR! not ok code 0Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels